From 456dab7df1c829c28c77844e2b6df38f78a967c9 Mon Sep 17 00:00:00 2001
From: wangfukang <15630117759@163.com>
Date: Tue, 24 Sep 2024 09:02:33 +0800
Subject: [PATCH] 11
---
pages/billing/addUser.vue | 58 +-
pages/billing/changeGoods1.vue | 8 +-
pages/index/checkShop.vue | 2 +-
.../index/customAndSupplierProductDetail.vue | 1469 -----------
pages/index/dataStatistics.vue | 276 +-
pages/index/home.vue | 2 +-
pages/index/index.vue | 191 +-
pages/index/shareStyle.vue | 128 +-
pages/inventory/goodsList1.vue | 2232 +++++++++++++----
pages/inventory/inventory.vue | 7 +-
pages/inventory/inventoryDetail.vue | 149 +-
pages/login/login.vue | 16 +-
12 files changed, 2423 insertions(+), 2115 deletions(-)
delete mode 100644 pages/index/customAndSupplierProductDetail.vue
diff --git a/pages/billing/addUser.vue b/pages/billing/addUser.vue
index 7c65e24..003c4cb 100644
--- a/pages/billing/addUser.vue
+++ b/pages/billing/addUser.vue
@@ -9,7 +9,11 @@
-
+
+
@@ -56,7 +60,8 @@
showPrice:false,
keyboardNum:'',
userInfo: '',
- show: false,
+ show: false,
+ categoryList:[],
goodsNum:'',
delShow: false,
addressObj: {},
@@ -70,7 +75,9 @@
province: '',
city: '',
area: '',
- noEarn:""
+ noEarn:"",
+ fenlei:'',
+ fenleiName:''
},
// 单选数据源
sexs: [{
@@ -122,7 +129,13 @@
onLoad(option) {
this.popleType = option.popleType
this.type = option.type
- let data = JSON.parse(option.data)
+ this.getCategoryList()
+ let data = ''
+ console.log(option.data)
+ if(option.data != undefined){
+ data = option.data
+ }
+ data = JSON.parse(data)
if (option.type = "edit") {
this.formData.address1 = data.province + data.city + data.area
this.formData.address = data.address
@@ -130,8 +143,9 @@
this.formData.city = data.city
this.formData.province = data.province
this.formData.id = data.id
- this.formData.consigneeMobile = data.consigneeMobile || data.phone || ""
- console.log(this.formData.consigneeMobile)
+ this.formData.fenlei = data.categoryId
+ this.formData.fenleiName = data.categoryName
+ this.formData.consigneeMobile = data.consigneeMobile || data.phone || ""
this.formData.consigneeName = data.consigneeName || data.name || ""
}
@@ -147,6 +161,34 @@
})
},
methods: {
+ //获取客户分类
+ getCategoryList(){
+ this.tui.request("/app/customerCategory/getCustomerCategoryListByShopId", "POST", {
+ shopId:uni.getStorageSync('shopId')
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ for(let i=0;i{
+ this.categoryList = res.result
+ },200)
+
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
+ },
+ //切换分类
+ categoryChange(e) {
+ for (let i = 0; i < this.categoryList.length; i++) {
+ if (this.categoryList[i].value == e) {
+ this.formData.fenlei = e;
+ this.formData.fenleiName = this.categoryList[i].text
+ }
+ }
+ },
//获取手机通讯录
getUserPhone() {
let that = this;
@@ -321,6 +363,8 @@
city: this.formData.city,
area: this.formData.area,
id: this.formData.id,
+ categoryId:this.formData.fenlei,
+ categoryName:this.formData.fenleiName,
userName: this.formData.consigneeMobile
}, false, true).then((res) => {
if (res.code == 200) {
@@ -349,6 +393,8 @@
province: this.formData.province,
city: this.formData.city,
area: this.formData.area,
+ categoryId:this.formData.fenlei,
+ categoryName:this.formData.fenleiName,
userName: this.formData.consigneeMobile,
amountOwed:this.formData.noEarn
}, false, true).then((res) => {
diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue
index 4526417..55f2bd6 100644
--- a/pages/billing/changeGoods1.vue
+++ b/pages/billing/changeGoods1.vue
@@ -11,7 +11,7 @@
:class="item.parentId ? 'red' :''">{{item.categoryName}}
-
+
@@ -966,9 +966,11 @@
})
await this.$nextTick(() => {
let data = {
+ attrId:this.goodsDetail.attrId,
id: this.goodsDetail.id,
price: this.zPrice,
num: this.zNum,
+ customerCategoryRule:JSON.parse(this.goodsDetail.customerCategoryRule),
categoryId: this.goodsDetail.categoryId,
productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn,
@@ -978,6 +980,7 @@
saleDetailQueryDTO: this.temporaryList,
saleDetailQueryDTO1: [],
purchasePrice: this.goodsDetail.purchasePrice,
+ unitPrice: this.goodsDetail.wholesalePrice,
wholesalePrice: this.goodsDetail.wholesalePrice,
lsprice: this.goodsDetail.price
}
@@ -1083,6 +1086,7 @@
}
this.$nextTick(() => {
let data = {
+ attrId:this.goodsDetail.attrId,
id: this.goodsDetail.id,
price: this.zPrice,
num: this.zNum,
@@ -1090,10 +1094,12 @@
productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn,
returnPrice: this.goodsDetail.wholesalePrice,
+ customerCategoryRule:JSON.parse(this.goodsDetail.customerCategoryRule),
productPicture: this.goodsDetail.productPicture,
supplierName: this.goodsDetail.supplierName,
saleDetailQueryDTO: newList,
saleDetailQueryDTO1: [],
+ unitPrice:this.goodsDetail.wholesalePrice,
purchasePrice: this.goodsDetail.purchasePrice,
wholesalePrice: this.goodsDetail.wholesalePrice,
lsprice: this.goodsDetail.price
diff --git a/pages/index/checkShop.vue b/pages/index/checkShop.vue
index 1060302..4448d4b 100644
--- a/pages/index/checkShop.vue
+++ b/pages/index/checkShop.vue
@@ -128,7 +128,7 @@
that.tui.toast('登录成功', 2000, true)
setTimeout(() => {
uni.reLaunch({
- url: '/package1/other/logistics'
+ url: '/package1/other/newLogisticsIndex'
})
}, 200)
},
diff --git a/pages/index/customAndSupplierProductDetail.vue b/pages/index/customAndSupplierProductDetail.vue
deleted file mode 100644
index 962c1ba..0000000
--- a/pages/index/customAndSupplierProductDetail.vue
+++ /dev/null
@@ -1,1469 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 日期:{{item.createTime | removeStr}}
-
-
- 操作:{{item.createByName}}
-
-
-
-
-
- 货号
- 数量
- 拿货金额
- 采购成本
- 利润
-
-
-
- {{item1.productSn}}
- {{item1.productCount == null ?'0':item1.productCount}}
- {{item1.discountAmount * item1.productCount}}
- {{userType == 0 && isDownKH == false?(item1.purchasePrice * item1.productCount):'0'}}
- {{userType == 0 && isDownKH == false?((item1.discountAmount - item1.purchasePrice)*item1.productCount).toFixed(2):0}}
-
-
-
- 总数量:
-
-
- {{item.productCount}}
-
-
-
-
-
- 拿货总价:
-
-
- {{item.totalAmount}}
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hi
-
-
-
- {{shopName+'对账单'}}
-
-
-
-
-
- 欢迎查看客户:{{duizhangList.userName == null ?"" : duizhangList.userName}}的对账单
-
-
-
- {{duizhangList.initialArrears >= 0?'期初欠款':'期初余额'}}
- {{duizhangList.initialArrears == null ?"0" :Math.abs(duizhangList.initialArrears)}}
-
-
- {{duizhangList.endArrears >= 0?'期末欠款':'期末余额'}}
- {{duizhangList.endArrears == null ?"0" :Math.abs(duizhangList.endArrears)}}
-
-
- {{duizhangList.arrears >= 0?'本期欠款':'本期余额'}}
- {{duizhangList.arrears == null ?"0" :Math.abs(duizhangList.arrears)}}
-
-
- 拿货总额
- {{duizhangList.totalSale == null ?"0" :duizhangList.totalSale}}
-
-
- 退货总额
- {{duizhangList.totalReturn == null ?"0" :duizhangList.totalReturn}}
-
-
-
-
-
-
-
-
-
-
- {{item.dealingsType == 0 ?"销售开单" :item.dealingsType == 1 ?"退货" :item.dealingsType == 2 ?"回款" :item.dealingsType == 3 && item.amount< 0?"初始余额" :item.dealingsType == 3 && item.amount>= 0?"初始欠款" :item.dealingsType == 4 ?"充值金额" :item.dealingsType == 5 ?"追加欠款" :item.dealingsType == 6 ?"撤销订单" :""}}
-
-
-
- {{item.createTime | removeStr}}
-
-
- 操作人:{{item.createByName == null ?"" :item.createByName}}
-
-
-
-
-
-
-
- 拿货数据~请查收
-
-
- 删除
-
-
- 删除
-
-
-
-
-
-
- 【销】
-
- 货号
-
- 数量
- 销售价
- 总价
-
-
-
-
-
- {{item1.productSn == null ?"" :item1.productSn}}
-
-
- {{item1.productCount == null ?"0" :item1.productCount}}
- {{item1.discountAmount == null ?"0" :item1.discountAmount}}
- {{item1.totalAmount == null ?"0" :item1.totalAmount}}
-
-
-
-
-
-
-
-
- 【退】
-
- 货号
-
-
- 数量
- 退货价
- 总价
-
-
-
-
-
- {{item1.productSn == null ?"" :item1.productSn}}
-
-
- {{item1.productCount == null ?"0" :item1.productCount}}
- {{item1.discountAmount == null ?"0" :item1.discountAmount}}
- {{item1.totalAmount == null ?"0" :item1.totalAmount}}
-
-
-
-
-
-
-
- 付款明细:
-
-
-
-
- 销售金额:{{item.totalAmount == null ?"0" :item.totalAmount}}
-
-
- 退货金额:{{item.returnSaleTotalAmount == null ?"0" :item.returnSaleTotalAmount}}
-
-
-
- 欠款抵退货:{{item.debtDeductionAmount == null ?"0" :item.debtDeductionAmount}}
-
- 销售抵退货:{{item.saleDeductionAmount == null ?"0" :item.saleDeductionAmount}}
-
-
- 余额抵销售:{{item.balanceDeductionAmount == null ?"0" :item.balanceDeductionAmount}}
-
-
-
-
- 本单应收:{{item.realAmount == null ?"0" :item.realAmount}}
- 本单实收:{{item.alreadyEarn == null ?"0" :item.alreadyEarn}}
-
-
-
-
- 之前欠款
- {{item.lastDebtAmount == null ?"0" :item.lastDebtAmount}}
-
-
- 之前余额
- {{item.lastDebtAmount == null ?"0" :Math.abs(item.lastDebtAmount)}}
-
-
- {{item.dealingsType == 5?'追加欠款':item.dealingsType == 4?'充值金额':item.dealingsType == 6?'撤销余额':'本单欠款'}}
- {{item.amount == null ?"0" :item.dealingsType == 5?Math.abs(item.amount):item.amount}}
-
-
- {{item.dealingsType == 4?'充值金额':item.dealingsType == 6?'撤销欠款':'本单余额'}}
- {{item.amount == null ?"0" :Math.abs(item.amount)}}
-
-
- {{item.dealingsType == 6?'撤销后欠款':'本单后欠款'}}
- {{item.balanceDue == null ?"0" :item.balanceDue}}
-
-
- {{item.dealingsType == 6?'撤销后余额':'本单后余额'}}
- {{item.balanceDue == null ?"0" :Math.abs(item.balanceDue)}}
-
-
-
-
- 对账时间:{{duizhangList.queryDate == null ?"" :duizhangList.queryDate}}
-
-
- 用快衣店AI,入库、开单更方便
-
-
-
-
-
-
- 货号:{{item.productSn}}
-
-
- 名称:{{item.productName}}
- 总数量:{{item.productCount == undefined ?'0':item.productCount}}
-
-
-
-
-
- 日期
- 数量
- 拿货价
- 采购价
- 利润
-
-
-
- {{item1.createTime | removeStr}}
- {{item1.productCount}}
- {{item1.customerBuyProductDetailLogVos[0].realPrice * item1.productCount}}
- {{userType == 0 && isDownKH == false?item1.customerBuyProductDetailLogVos[0].purchasePrice * item1.productCount:0}}
- {{userType == 0 && isDownKH == false?((item1.customerBuyProductDetailLogVos[0].realPrice - item1.customerBuyProductDetailLogVos[0].purchasePrice) * item1.productCount).toFixed(2):0}}
-
-
-
-
-
-
-
-
-
- 日期:{{item.createTime | removeStr}}
-
-
- 操作:{{item.createByName}}
-
-
-
-
-
- 货号
- 数量
- 退货价
- 采购价
-
-
-
- {{items.productSn}}
- {{items.productCount}}
- {{items.discountAmount}}
- {{userType == 0 && isDownKH == false?items.purchasePrice == null?0:items.purchasePrice:0}}
-
-
-
-
-
-
-
- 采购价:{{item.purchaseDetails[0].purchasePrice?item.purchaseDetails[0].purchasePrice:'暂无'}}
- 总数量:{{item.purchase.totalAmount?item.purchase.totalAmount:'暂无'}}
-
-
- 商品规格
- 总数量
-
-
-
-
- {{data.attributeList | sliceMsg}}
-
-
- {{data.productCount}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 日期:{{item.purchase.createTime}}
-
-
- 操作:{{item.purchase.createByName}}
-
-
-
-
-
- 货号
- 数量
- 采购价
- 总金额
-
-
-
- {{item1.productSn}}
- {{item1.productCount == null ?'0':item1.productCount}}
- {{item1.purchasePrice?item1.purchasePrice:0}}
- {{item1.productCount * item1.purchasePrice || 0}}
-
-
-
- 总数量:
-
-
- {{item.purchase.productCount}}
-
-
- 总价:
-
-
- {{item.purchase.shouldPay}}
-
-
-
-
-
-
-
-
-
-
-
-
-
- Hi
-
-
-
- {{shopName+'对账单'}}
-
-
-
-
-
- 欢迎查看供应商:{{duizhangList.userName == null ?"" : duizhangList.userName}}的对账单
-
-
-
- {{duizhangList.initialArrears >= 0?'期初欠款':'期初余额'}}
- {{duizhangList.initialArrears == null ?"0" :Math.abs(duizhangList.initialArrears)}}
-
-
- {{duizhangList.endArrears >= 0?'期末欠款':'期末余额'}}
- {{duizhangList.endArrears == null ?"0" :Math.abs(duizhangList.endArrears)}}
-
-
- {{duizhangList.arrears >= 0?'本期欠款':'本期余额'}}
- {{duizhangList.arrears == null ?"0" :Math.abs(duizhangList.arrears)}}
-
-
- 拿货总额
- {{duizhangList.totalSale == null ?"0" :duizhangList.totalSale}}
-
-
-
-
-
-
-
-
-
-
-
- {{item.dealingsType == 0 ?"销售开单" :item.dealingsType == 1 ?"退货" :item.dealingsType == 2 ?"回款" :item.dealingsType == 3 && item.amount< 0?"初始余额" :item.dealingsType == 3 && item.amount>= 0?"初始欠款" :item.dealingsType == 4 ?"充值金额" :item.dealingsType == 5 ?"追加欠款" :item.dealingsType == 6 ?"撤销订单" :item.dealingsType == 7 ?"采购订单" :item.dealingsType == 9 ?"采购退货":""}}
-
-
-
- 操作时间:{{item.createTime | removeStr}}
-
-
- 拿货时间:{{item.purchaseTime | removeStr}}
-
-
- 操作人:{{item.createByName == null ?"" :item.createByName}}
-
-
-
-
-
-
- 拿货数据~请查收
-
-
- 删除
-
-
- 删除
-
-
-
-
-
- 货号
-
- 数量
- 拿货价
- 总价
-
-
-
-
-
- {{item1.productSn == null ?"" :item1.productSn}}
-
-
- {{item1.productCount == null ?"0" :item1.productCount}}
- {{item1.totalAmount / item1.productCount}}
- {{item1.totalAmount == null ?"0" :item1.totalAmount}}
-
-
-
-
-
- 付款明细:
-
-
-
-
- 退货金额:{{item.shouldPay == null ?"0" :item.shouldPay}}
- 拿货金额:{{item.shouldPay == null ?"0" :item.shouldPay}}
-
-
-
-
- 余额抵进货:{{item.balanceDeductionAmount == null ?"0" :item.balanceDeductionAmount}}
-
-
-
-
- 本单应付:{{item.shouldPay == null ?"0" :item.shouldPay}}
- 本单实付:{{item.alreadyPay == null ?"0" :item.alreadyPay}}
-
-
-
-
- 之前欠款
- {{item.lastDebtAmount == null ?"0" :item.lastDebtAmount}}
-
-
- 之前余额
- {{item.lastDebtAmount == null ?"0" :Math.abs(item.lastDebtAmount)}}
-
-
- {{item.dealingsType == 5?'追加欠款':item.dealingsType == 4?'充值金额':item.dealingsType == 6?'撤销欠款':item.dealingsType == 9?'本单退款':'本单欠款'}}
- {{item.amount == null ?"0" :item.dealingsType == 5?Math.abs(item.amount):item.amount}}
-
-
- {{item.dealingsType == 4?'充值金额':item.dealingsType == 6?'撤销余额':item.dealingsType == 9?'本单退款':'本单余额'}}
- {{item.amount == null ?"0" :Math.abs(item.amount)}}
-
-
- {{item.dealingsType == 6?'撤销后欠款':'本单后欠款'}}
- {{item.balanceDue == null ?"0" :item.balanceDue}}
-
-
- {{item.dealingsType == 6?'撤销后余额':'本单后余额'}}
- {{item.balanceDue == null ?"0" :Math.abs(item.balanceDue)}}
-
-
-
-
- 对账时间:{{duizhangList.queryDate == null ?"" :duizhangList.queryDate}}
-
-
- 用快衣店AI,入库、开单更方便
-
-
-
-
-
-
- 货号:{{item.productSn}}
-
-
- 名称:{{item.productName}}
- 总数量:{{item.productCount == undefined ?'0':item.productCount}}
-
-
-
-
-
- 日期
- 数量
-
- 采购价
- 总金额
-
-
-
-
- {{item1.createTime | removeStr}}
- {{item1.productCount}}
-
- {{userType == 0 ?(item1.supplierBuyProductDetailLogVos[0].purchasePrice == null?0:item1.supplierBuyProductDetailLogVos[0].purchasePrice):0}}
- {{item1.productCount * item1.supplierBuyProductDetailLogVos[0].purchasePrice || 0}}
-
-
-
-
-
-
-
-
-
-
- 日期:{{item.createTime | removeStr}}
-
-
- 操作:{{item.createByName}}
-
-
-
-
-
- 货号
- 数量
- 退货价
- 采购价
-
-
-
- {{items.productSn}}
- {{item.productCount}}
- {{items.discountAmount}}
- {{userType == 0 && isDownKH == false?items.purchasePrice == null?0:items.purchasePrice:0}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 规格数量详情
-
-
-
-
- 规格
- 数量
-
-
-
- {{item.attributeList | sliceMsg}}
- {{item.productCount}}
-
-
-
-
-
-
-
-
-
-
-
- {{detailList.productName}}({{detailList.productSn}})
-
-
-
-
- 规格
- 数量
-
-
-
- {{item.attributeList | sliceMsg}}
- {{item.productCount}}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/index/dataStatistics.vue b/pages/index/dataStatistics.vue
index 9592cc1..c8d6b14 100644
--- a/pages/index/dataStatistics.vue
+++ b/pages/index/dataStatistics.vue
@@ -50,18 +50,221 @@
-->
-
+
-
+
- {{item.name}}
+ 销售金额
- {{item.name == '销售金额'?shopInfo.totalAmount:item.name == '销售总件数'?shopInfo.totalJCount:item.name == '退货总件数'?shopInfo.returnTotalCount:item.name == '实收金额'?shopInfo.totalAlreadyEarn:item.name == '利润' && type == 0?shopInfo.totalProfit:item.name == '进货金额' && type == 0?shopInfo.purchasingCost:item.name == '退货金额'?shopInfo.returnTotalAmount:item.name == '下单客户'?shopInfo.totalCCount:""}}
+ {{shopInfo.totalAmount}}
+
+
+
+
+
+ 销售总件数
+
+
+ {{shopInfo.totalJCount}}
+
+
+
+
+
+
+
+
+
+ 销售利润
+
+
+ {{shopInfo.totalProfit==null?0:shopInfo.totalProfit}}
+
+
+
+
+
+
+
+
+ 实际利润
+
+
+ {{((shopInfo.totalProfit == null?0:shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}
+
+
+
+
+
+
+
+
+
+ 进货金额
+
+
+ {{shopInfo.purchasingCost}}
+
+
+
+
+
+
+
+
+ 进货总件数
+
+
+ {{shopInfo.purchasingCount}}
+
+
+
+
+
+
+
+
+
+ 退货金额
+
+
+ {{shopInfo.returnTotalAmount}}
+
+
+
+
+
+
+
+
+ 退货总件数
+
+
+ {{shopInfo.returnTotalCount}}
+
+
+
+
+
+
+
+
+
+ 实收金额
+
+
+ {{shopInfo.totalAlreadyEarn}}
+
+
+
+
+
+
+
+
+ 下单客户
+
+
+ {{shopInfo.totalCCount}}
+
+
+
+
+
+
+
+
+ 热销商品
+
+
+
+
+
+
+
+
+
+
+ 利润明细
+
+
+
+ {{shopInfo.totalAmount}}
+ 销售金额
+
+
+ {{shopInfo.totalAmount - shopInfo.totalProfit}}
+ 销售成本
+
+
+ {{shopInfo.returnTotalAmount}}
+ 退货金额
+
+
+ {{shopInfo.saleReturnCost}}
+ 退货成本
+
+
+
+
+ 点击↓↓↓可查看计算公式
+
+
+ {{shopInfo.totalProfit}}
+ 销售利润
+
+
+
+ {{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}
+ 实际利润
+
+
+ {{shopInfo.totalProfit == 0?0:((shopInfo.totalProfit/shopInfo.totalAmount)*100).toFixed(2)}}%
+ 销售利润率
+
+
+ {{(shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==0?0:(((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)/(shopInfo.totalAmount-shopInfo.returnTotalAmount))*100).toFixed(2)}}%
+ 实际利润率
+
+
+
+
+
+
+ 确定
+
+
+
+
+
+ {{showDan == 0?'销售利润':showDan == 1?'实际利润':showDan == 2?'实际利润率':showDan == 3?'销售利润率':''}}计算公式
+
+
+
+ 公式:销售利润/销售金额*100
+ {{shopInfo.totalProfit}}/{{shopInfo.totalAmount}}*100={{(shopInfo.totalProfit == 0 && shopInfo.totalAmount == 0)?0:((shopInfo.totalProfit/shopInfo.totalAmount)*100).toFixed(2)}}%
+
+
+ 公式:实际利润/(销售金额-退货金额)
+ {{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}/{{shopInfo.totalAmount - shopInfo.returnTotalAmount}} * 100={{(shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==0?0:(((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)/(shopInfo.totalAmount-shopInfo.returnTotalAmount))*100).toFixed(2)}}%
+
+
+ 公式:销售利润-(退货金额-退货成本)
+ {{shopInfo.totalProfit}}-({{shopInfo.returnTotalAmount}}-{{shopInfo.saleReturnCost}})={{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}
+
+
+ 公式:销售金额-销售成本
+ {{shopInfo.totalAmount}}-{{shopInfo.totalAmount - shopInfo.totalProfit}}={{shopInfo.totalProfit}}
+
+
+
@@ -70,8 +273,15 @@
export default {
data() {
return {
+ showDan:'',
+ showFormula: false,
range:[],
- shopInfo:{},
+ shopInfo:{
+ totalProfit:0,
+ returnTotalAmount:0,
+ saleReturnCost:0
+ },
+ showDayPrice: false,
type:uni.getStorageSync('type'),
dataList:[{
name:'销售金额',
@@ -86,13 +296,21 @@
value:'shishou',
icon:'auth'
},{
- name:'利润',
- value:'lirun',
+ name:'销售利润',
+ value:'xiaoshoulirun',
+ icon:'wallet'
+ },{
+ name:'实际利润',
+ value:'shijilirun',
icon:'wallet'
},{
name:'进货金额',
value:'jinhuo',
icon:'home'
+ },{
+ name:'进货总件数',
+ value:'jinhuo',
+ icon:'home'
},{
name:'退货金额',
value:'tuihuo',
@@ -103,8 +321,12 @@
icon:'refreshempty'
},{
name:'下单客户',
- value:'xiadankehu',
+ value:'xiadan',
icon:'staff'
+ },{
+ name:'热销商品',
+ value:'rexiao',
+ icon:'fire'
}]
};
},
@@ -116,19 +338,37 @@
},
methods: {
goDetail(item){
- if(item.value == 'lirun'){
+ if(item == 'xiaoshoulirun'){
uni.navigateTo({
- url:'/package1/index/lirun?value='+ item.value + '&range=' + JSON.stringify(this.range)
+ url:'/package1/index/lirun?value='+ item + '&range=' + JSON.stringify(this.range)
+ })
+ }else if(item == 'shijilirun'){
+ this.showDayPrice = true
+ }else if(item == 'rexiao'){
+ uni.navigateTo({
+ url:'/package1/index/fireGoods'
})
}else{
uni.navigateTo({
- url:'/package1/index/statisticsDetail?value='+ item.value + '&range=' + JSON.stringify(this.range)
+ url:'/package1/index/statisticsDetail?value='+ item + '&range=' + JSON.stringify(this.range)
})
}
},
+ changeFormula(type){
+ console.log(type)
+ this.showFormula = true
+ this.showDan = type
+ setTimeout(res=>{
+ this.showFormula = false
+ },2000)
+ },
getSaleInfo() {
- this.shopInfo = {}
+ this.shopInfo = {
+ totalProfit:0,
+ returnTotalAmount:0,
+ saleReturnCost:0
+ }
this.tui.request("/app/sale/getShopAll", "POST", {
pageVo: {
pageSize: 5,
@@ -273,4 +513,16 @@
font-size: 34rpx;
border-bottom: 1px solid #eee;
}
+ .tan-lirun{
+ margin-top: 20rpx;
+ width: 45%;
+ height: 60px;
+ display: flex;
+ flex-direction: column;
+ text-align: center;
+ float: left;
+ background-image: linear-gradient(#84C1FF, #C4E1FF) !important;
+ color: #fff;
+ border-radius: 10px;
+ }
\ No newline at end of file
diff --git a/pages/index/home.vue b/pages/index/home.vue
index bf55cf6..1e6ddb2 100644
--- a/pages/index/home.vue
+++ b/pages/index/home.vue
@@ -16,7 +16,7 @@
if (uni.getStorageSync('hiver_token')) {
if (uni.getStorageSync('wayValue') == 1) {
uni.reLaunch({
- url: '/package1/other/logistics'
+ url: '/package1/other/newLogisticsIndex'
})
} else if (uni.getStorageSync('wayValue') == 0) {
uni.reLaunch({
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 6133bf1..5ecf9b0 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -7,12 +7,10 @@
-
+
- 待退货
- {{waitCount.waitReturnCount > 99 ? '99+' :waitCount.waitReturnCount}}
+ 热销商品
-
-
+
+
今日利润
+
@@ -149,6 +149,8 @@
+
-
-
X
@@ -207,6 +209,86 @@
+
+
+ {{showDan == 0?'销售利润':showDan == 1?'实际利润':showDan == 2?'实际利润率':showDan == 3?'销售利润率':''}}计算公式
+
+
+
+ 公式:销售利润/销售金额*100
+ {{shopInfo.totalProfit}}/{{shopInfo.totalAmount}}*100={{(shopInfo.totalProfit == 0 && shopInfo.totalAmount == 0)?0:((shopInfo.totalProfit/shopInfo.totalAmount)*100).toFixed(2)}}%
+
+
+ 公式:实际利润/(销售金额-退货金额)
+ {{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}/{{shopInfo.totalAmount - shopInfo.returnTotalAmount}} * 100={{(shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==0?0:(((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)/(shopInfo.totalAmount-shopInfo.returnTotalAmount))*100).toFixed(2)}}%
+
+
+ 公式:销售利润-(退货金额-退货成本)
+ {{shopInfo.totalProfit}}-({{shopInfo.returnTotalAmount}}-{{shopInfo.saleReturnCost}})={{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}
+
+
+ 公式:销售金额-销售成本
+ {{shopInfo.totalAmount}}-{{shopInfo.totalAmount - shopInfo.totalProfit}}={{shopInfo.totalProfit}}
+
+
+
+
+
+
+
+ 利润明细
+
+
+
+ {{shopInfo.totalAmount}}
+ 销售金额
+
+
+ {{shopInfo.totalAmount - shopInfo.totalProfit}}
+ 销售成本
+
+
+ {{shopInfo.returnTotalAmount}}
+ 退货金额
+
+
+ {{shopInfo.saleReturnCost}}
+ 退货成本
+
+
+
+
+ 点击↓↓↓可查看计算公式
+
+
+ {{shopInfo.totalProfit}}
+ 销售利润
+
+
+
+ {{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}
+ 实际利润
+
+
+ {{shopInfo.totalProfit == 0 ?0:((shopInfo.totalProfit/shopInfo.totalAmount)*100).toFixed(2)}}%
+ 销售利润率
+
+
+
+ {{(shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==0?0:(((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)/(shopInfo.totalAmount-shopInfo.returnTotalAmount))*100).toFixed(2)}}%
+ 实际利润率
+
+
+
+
+
+
+ 确定
+
+
+
@@ -224,11 +306,14 @@
src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
inventoryList: [],
settingShow: false,
- chartData: {},
+ showFormula: false,
+ chartData: {},
+ showDan:'',
returnList:new Map(),
shopName: '',
waimaiRight:'-70rpx',
showDayPrice: false,
+ shijiPrice:false,
opts: {
padding: [15, 10, 0, 15],
dataLabel: true,
@@ -264,7 +349,19 @@
}
},
},
- shopInfo: {},
+ shopInfo: {
+ totalAmount: 0,
+ totalAlreadyEarn: 0,
+ totalPayAmount: 0,
+ totalCCount: 0,
+ totalCount: 0,
+ totalJCount: 0,
+ totalProfit: 0,
+ saleReturnCost:0,
+ returnTotalAmount: 0,
+ returnTotalCount: 0,
+ totalAlreadyEarnDetail: 0
+ },
waitCount: {},
enDayShow:false,
endDay:'',
@@ -282,6 +379,7 @@
},
onShow() {
this.getSaleInfo()
+ this.getEndTime()
},
onLoad() {
let that = this;
@@ -303,7 +401,7 @@
that.type = res.data
}
});
- this.getEndTime()
+
var today = new Date();
var day = today.getDate();
//宣传页
@@ -321,26 +419,18 @@
methods: {
//获取店铺到期时间
getEndTime(){
- var today = new Date();
- var day = today.getDate();
- if(uni.getStorageSync('endTime')){
- this.endTime = uni.getStorageSync('endTime')
- this.endDay = this.daysUntil(this.endTime)
+ this.textArr = []
+ this.tui.request("/app/shop/getShopInfoById", "post", {
+ id: uni.getStorageSync('shopId')
+ }, false, true).then((res) => {
+ uni.setStorageSync('endTime',res.result.endTime)
+ this.endTime = res.result.endTime
+ this.endDay = this.daysUntil(res.result.endTime)
if(this.endDay < 7){
this.enDayShow = true
}
- }else{
- this.tui.request("/app/shop/getShopInfoById", "post", {
- id: uni.getStorageSync('shopId')
- }, false, true).then((res) => {
- uni.setStorageSync('endTime',res.result.endTime)
- this.endTime = res.result.endTime
- this.endDay = this.daysUntil(res.result.endTime)
- if(this.endDay < 7){
- this.enDayShow = true
- }
- })
- }
+ })
+
setTimeout(res1=>{
if(this.endTime != undefined){
let text = '您的店铺有效期至'+this.endTime+',还有'+this.endDay+'天到期,请及时联系管理员续费或开通'
@@ -357,6 +447,14 @@
const daysDifference = Math.ceil(differenceInMs / (1000 * 60 * 60 * 24));
return daysDifference;
},
+ changeFormula(type){
+ console.log(type)
+ this.showFormula = true
+ this.showDan = type
+ setTimeout(res=>{
+ this.showFormula = false
+ },2000)
+ },
popClose() {
this.$refs.publicizepopup.close()
},
@@ -487,7 +585,7 @@
obj.productName = item.saleDetailDTOList[i].productName
obj.productPicture = item.saleDetailDTOList[i].productPicture + '?time=' + new Date().getTime()
obj.productSn = item.saleDetailDTOList[i].productSn
- obj.wholesalePrice = item.saleDetailDTOList[i].discountAmount?item.saleDetailDTOList[i].discountAmount:item.saleDetailDTOList[i].wholesalePrice
+ obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
// obj.discountAmount = item.saleDetailDTOList[i].discountAmount
obj.returnPrice = item.saleDetailDTOList[i].returnPrice
obj.saleId = item.id
@@ -527,7 +625,19 @@
})
},
getSaleInfo() {
- this.shopInfo = {}
+ this.shopInfo = {
+ totalAmount: 0,
+ totalAlreadyEarn: 0,
+ totalPayAmount: 0,
+ totalCCount: 0,
+ totalCount: 0,
+ totalJCount: 0,
+ totalProfit: 0,
+ saleReturnCost:0,
+ returnTotalAmount: 0,
+ returnTotalCount: 0,
+ totalAlreadyEarnDetail: 0
+ }
this.inventoryList = []
this.tui.request("/app/sale/getShopAll", "POST", {
pageVo: {
@@ -544,6 +654,7 @@
totalCount: res.result.totalCount,
totalJCount: res.result.totalJCount,
totalProfit: res.result.totalProfit,
+ saleReturnCost:res.result.saleReturnCost,
returnTotalAmount: res.result.returnTotalAmount,
returnTotalCount: res.result.returnTotalCount,
totalAlreadyEarnDetail: res.result.totalAlreadyEarnDetail
@@ -814,14 +925,14 @@
}
.publicize-content {
- width: 460rpx;
- height: 600rpx;
+ width: 600rpx;
+ height: 700rpx;
}
.publicize-content img {
- width: 460rpx;
- height: 460rpx;
+ width: 600rpx;
+ height: 600rpx;
border-radius: 50px;
}
@@ -883,4 +994,16 @@
line-height: 60rpx;
font-size: 30rpx;
}
+ .tan-lirun{
+ margin-top: 20rpx;
+ width: 45%;
+ height: 60px;
+ display: flex;
+ flex-direction: column;
+ text-align: center;
+ float: left;
+ background-image: linear-gradient(#84C1FF, #C4E1FF) !important;
+ color: #fff;
+ border-radius: 10px;
+ }
\ No newline at end of file
diff --git a/pages/index/shareStyle.vue b/pages/index/shareStyle.vue
index 5f08960..18b3158 100644
--- a/pages/index/shareStyle.vue
+++ b/pages/index/shareStyle.vue
@@ -10,7 +10,7 @@
:class="item.parentId ? 'red' :''">{{item.categoryName}}
-
+
@@ -155,6 +155,10 @@
+
+
+
+
@@ -163,6 +167,7 @@
components: {},
data() {
return {
+ canvasshow:false,
indexList: [],
pageNum: 1, //分页的页码
shopList: [],
@@ -182,7 +187,9 @@
gwcList: [],
checkPayData:'',
data:{},
- height:0
+ height:0,
+ base64:'',
+ tempFilePath:''
}
},
created() {
@@ -232,6 +239,112 @@
this.shopName = options.shopName ? options.shopName : uni.getStorageSync('shopName')
},
methods: {
+ getUserData(khid){
+ let that = this;
+ this.tui.request("/order/ow/getWechatQrcode", "post", {
+ page: 'package1/index/downStearmList',
+ scene:khid,
+ envVersion: __wxConfig.envVersion,
+ }, false, true).then((res1) => {
+ console.log('getWechatQrcode',res1)
+ if (res1.code == 200) {
+ let imgA = res1.result;
+ uni.downloadFile({
+ url: imgA,
+ success: (res2) => {
+ console.log('downloadFile',res2)
+ this.base64 = res2.tempFilePath
+ if(this.data.shareType == "1"){
+ uni.showLoading({
+ title:'请求中...'
+ })
+ setTimeout(res3=>{
+ uni.hideLoading()
+ uni.showModal({
+ title:'提示',
+ content:'确定要分享全部吗?',
+ success(res3) {
+ if(res3.confirm){
+ console.log('点了确定')
+ that.getData()
+ }
+ }
+ })
+ },500)
+
+
+ }else{
+ this.$refs.share.open()
+ }
+ }
+ });
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {
+ console.log('报错',res)
+ })
+ },
+ getData() {
+ let that = this
+ uni.showLoading({
+ title:'生成中...'
+ })
+ this.canvasshow = true
+ const ctx = uni.createCanvasContext('myCanvas', this);
+ //背景图
+ let imgA = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/0f96ca9700b741d486dd23bbe4e0f970.jpg';
+ uni.downloadFile({
+ url: imgA,
+ success: (res2) => {
+ console.log('下载北京图',res2)
+ if (res2.statusCode === 200) {
+ // // 绘制第一张图片
+ ctx.drawImage(res2.tempFilePath, 0, 0, 1700, 2200);
+ ctx.draw()
+ // 绘制第二张图片
+ ctx.drawImage(that.base64, 650, 850, 400, 400);
+ ctx.draw(true);
+ // 设置字体样式
+ ctx.font = 'bold 200px SimSun';
+ // 设置文字颜色
+ ctx.fillStyle = '#088FEB';
+
+ var text = this.shopName;
+ var textWidth = ctx.measureText(text).width;
+ console.log(textWidth)
+ // 计算居中位置
+ var x = (1700 - textWidth) / 2;
+
+ // 绘制文字
+ ctx.fillText(text, x, 700);
+ ctx.draw(true)
+ setTimeout(ress=>{
+ uni.canvasToTempFilePath({
+ x: 0,
+ y: 0,
+ width: 1700,
+ height: 2200,
+ destWidth: 1701,
+ destHeight: 2200,
+ canvasId: 'myCanvas',
+ success: (res3) => {
+
+ console.log('图片预览',res3.tempFilePath)
+ this.canvasshow = false
+ this.tempFilePath = res3.tempFilePath
+ uni.previewImage({
+ urls: [res3.tempFilePath]
+ })
+ uni.hideLoading()
+ }
+ });
+ },500)
+ }
+ }
+ });
+
+ },
//初始化获取分类列表
getGategoryList() {
this.tui.request("/app/productCategory/list", "get", {
@@ -457,19 +570,20 @@
}
})
},
- checkPay(type){
+ checkPay(type){
+ let that = this;
this.data.priceType = type
this.tui.request("/app/productShare/save", "POST", this.data, false, true).then((res) => {
if (res.code == 200) {
- this.khid = res.result.id
+ this.khid = res.result.id
+ this.getUserData(this.khid)
} else {
this.tui.toast(res.message)
}
- }).catch((res) => {})
- this.checkPayData = type
+ }).catch((res) => {})
+ this.checkPayData = type
this.$refs.payDialog.close()
- this.$refs.share.open()
},
//关闭购物车弹窗
closeCar() {
diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue
index de29043..6a5b73f 100644
--- a/pages/inventory/goodsList1.vue
+++ b/pages/inventory/goodsList1.vue
@@ -2,7 +2,7 @@
-
+
@@ -50,7 +50,7 @@
-
+
@@ -133,13 +133,13 @@
style="height: 27px;width: 70px;background: #088FEB;color: #fff;border-radius: 5px;text-align: center;position: absolute;top: 236rpx;right: 0px;line-height: 54rpx;">
添加规格
-
上次价格
-
+ -->
-
+
+
+
+ 同款退货
+
+ style="background:#088FEB;position: absolute;top: 80rpx;right: 0;" class="left-btn">
改价
+ style="background:#088FEB;position: absolute;top: 146rpx;right: 0;" class="left-btn">
添加规格
+ style="background:#088FEB;position: absolute;top: 15rpx;right: 0;" class="left-btn">
上次价格
+
+
+
+
+
+
+ {{numData(values1[0])[0]}}
+
+
+ {{numData(values1[0])[1]}}
+
+
+ {{values1[1].productNum == null ?'无库存':values1[1].productNum}}
+
+
+
+
+ -
+
+
+
+ +
+
+
+
+
+
@@ -288,7 +325,7 @@
-
+
客户:{{khName.name?khName.name:''}}
@@ -306,6 +343,11 @@
placeholder="请选择支付类型" @change="payTypeChange" style="width: 60%;">
+
+ 销售员
+
+
销售金额
@@ -399,20 +441,23 @@
-
+
+
备注
+
+ 开单时间
+
+
+
-
- 销售员
-
-
+
-
+
@@ -578,8 +623,9 @@
@@ -960,6 +1006,110 @@
+
+
+
+
+
@@ -1041,7 +1191,7 @@
您的货号为“
- {{item}}、”的商品售价为0,是否继续开单?
+ {{item}}”的商品售价为0,是否继续开单?
@@ -1090,6 +1240,7 @@
priceCurrent: '',
voiceGetOneData: true,
goodsDetail: [],
+ goodsReturnDetail: [],
childrenId: '',
noticeData: ['您每发出一个包,使用拉包工和物流公司送货时,我们将从中拿出XX元,捐入快拾帮帮公益基金中,帮助那些贫困儿童!我们的付出将让世界充满爱!'],
columns: [],
@@ -1097,7 +1248,10 @@
index: '',
temporary: [],
temporaryList: [],
+ temporaryReturnList: [],
+ zReturnNum: 0,
zNum: 0,
+
zPrice: 0,
priceOk: '', //已收金额
value: 0,
@@ -1192,6 +1346,7 @@
carList: new Map(), //添加商品页传回来的商品信息
xsyId: '',
shouldPay: 0,
+ single: '',
methodText: '',
methodMask: false,
returnPay: 0,
@@ -1218,6 +1373,7 @@
radioType1: 0,
linshiPrice: 0,
snName: '',
+ shopId:uni.getStorageSync('shopId'),
saleDetailList: [],
clearMsg: '',
snList: [],
@@ -1228,12 +1384,17 @@
historyList: {},
afterPrice: 0, //第二次选择商品的时候,先计算这个价格,实收金额= 已经存在的实收金额 + afterPrice
pageOldTemList: [],
+ pageOldTemReturnList: [],
indexList: [],
categoryText: '',
oldTemList: [],
+ oldTemReturnList: [],
goodsList: [],
+ goodsReturnList: [],
+
saleId: '',
newTemList: [],
+ newTemReturnList: [],
pecsList: [],
oneGoodsId: '',
dataObj: new Map(),
@@ -1243,6 +1404,7 @@
currentAnchor: '',
temporaryNum: 0,
keyboard: '',
+ onePecsReturnNum:0,
keyboardIndex: '',
aiNotRecognition: '',
getMsg: '',
@@ -1290,6 +1452,7 @@
} else {
this.khName = uni.getStorageSync('khName') ? JSON.parse(uni.getStorageSync('khName')) : JSON.parse(JSON
.stringify(this.khName))
+ this.getkhName(this.khName.name)
}
if (this.khName != '') {
if (this.khName.noEarn != null && this.zhiqianqiankuan != this.khName.noEarn) {
@@ -1300,6 +1463,42 @@
} else {
this.zhiqianqiankuan = this.khName.noEarn
}
+ console.log(this.khName)
+ console.log(this.carList)
+ if(this.khName.categoryId != null){
+ this.carList.forEach(function(value, key) {
+ if(value.customerCategoryList != null){
+ let ischeckCustom = false
+ let truePrice = 0
+ let ischeckCustomPrice = false
+ for(let i=0;i {
@@ -1440,10 +1658,26 @@
this.goodsNum = Number(this.keyboardNum)
} else if (this.keyboard == 'zongjishu') {
this.allChange(Number(this.keyboardNum))
+ }else if (this.keyboard == 'zongReturnjishu') {
+ if(this.keyboardNum > 0){
+ this.tui.toast('退货数量不能为正数')
+ return
+ }else{
+ this.allReturnChange(Number(this.keyboardNum))
+ }
+
} else if (this.keyboard == 'danjishu') {
this.numChange(Number(this.keyboardNum), this.keyboardIndex)
+ }else if (this.keyboard == 'returndanjishu') {
+ this.numReturnChange(Number(this.keyboardNum), this.keyboardIndex)
} else if (this.keyboard == 'mapdanjishu') {
this.mapnumChange(Number(this.keyboardNum), this.keyboardIndex[0], this.keyboardIndex[1])
+ }else if (this.keyboard == 'returnmapdanjishu') {
+ if(Number(this.keyboardNum) > 0){
+ this.tui.toast('退货栏输入金额不能为正数')
+ }else{
+ this.mapnumReturnChange(Number(this.keyboardNum), this.keyboardIndex[0], this.keyboardIndex[1])
+ }
} else if (this.keyboard == 'danjia') {
this.clickCollapse(Number(this.keyboardNum), this.keyboardIndex)
} else if (this.keyboard == 'priceOk') {
@@ -1599,7 +1833,6 @@
info[name] = match[1].trim();
}
});
- console.log('info', info)
if (info.productCount && info.productCount.indexOf(',') != -1) {
info.productCount = info.productCount.split(',')[0]
}
@@ -1614,18 +1847,24 @@
}
return info;
},
+ maskClick() {
+ console.log('maskClick事件:', this.single);
+ },
handleData(isTrue) {
let that = this;
+ console.log('carList1',this.carList1)
for (let i = 0; i < this.carList1.length; i++) {
if (this.carList1[i].saleDetailQueryDTO) {
if (this.carList.size == 0) { //当前页没有数据
let obj = {
+ attrId: this.carList1[i].attrId,
purchasePrice: this.carList1[i].purchasePrice, //采购价
price: 0, //总价
discount: 10, //折扣
+ customerCategoryList:this.carList1[i].customerCategoryRule,
categoryId: this.carList1[i].categoryId,
unitPrice: this.carList1[i].unitPrice || 0, //单价
- discountAmount: this.carList1[i].wholesalePrice || 0, //折后价
+ discountAmount: this.carList1[i].discountAmount>0? this.carList1[i].discountAmount:( this.carList1[i].wholesalePrice || 0), //折后价
returnPrice: this.carList1[i].returnPrice ? this.carList1[i].returnPrice : this
.carList1[i].wholesalePrice || 0,
disNoAmount: 0, //折前价,用于计算整体折扣
@@ -1638,9 +1877,36 @@
productPicture: this.carList1[i].productPicture,
productSn: this.carList1[i].productSn,
stockLogList: new Map(),
+ returnList: new Map(),
+ returnList1: [],
stockLogList1: [],
supplierName: this.carList1[i].supplierName //供应商
}
+ console.log(this.khName)
+ console.log(obj)
+ if(this.khName.categoryId != null){
+ if(obj.customerCategoryList != null){
+ for(let i=0;i= 0){
+ // this.carList.get(this.carList1[i].id).productCount += data1.productCount
+ // }else if(data1.productCount < 0){
+ // this.carList.get(this.carList1[i].id).returnCount += Math.abs(data1.productCount)
+ // }
+
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
.saleDetailQueryDTO[m].attributeList, data1)
-
- // this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
- // .saleDetailQueryDTO[m].attributeList, this.carList.get(this.carList1[i].id).stockLogList.get(
- // this.carList1[i].saleDetailQueryDTO[m].attributeList) + this.carList1[i]
- // .saleDetailQueryDTO[m].productCount)
- // this.carList.get(this.carList1[i].id).productCount += this.carList1[i]
- // .saleDetailQueryDTO[m].productCount
} else { //规格不同
- // this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
- // .saleDetailQueryDTO[
- // m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount)
- // this.carList.get(this.carList1[i].id).productCount += this.carList1[i]
- // .saleDetailQueryDTO[
- // m].productCount
var data1 = {
productCount: Number(this.carList1[i].saleDetailQueryDTO[m].productCount),
@@ -1703,26 +1963,41 @@
undefined ? this.carList1[i].saleDetailQueryDTO[m].productNum : this
.carList1[i].saleDetailQueryDTO[m].stockCount
}
+ // if(data1.productCount >= 0){
+ // this.carList.get(this.carList1[i].id).productCount += data1.productCount
+ // }else if(data1.productCount < 0){
+ // this.carList.get(this.carList1[i].id).returnCount += Math.abs(data1.productCount)
+ // }
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
.saleDetailQueryDTO[
m].attributeList, data1)
}
- if (this.carList1[i].saleDetailQueryDTO[m].productCount < 0) { //退货数量
- this.carList.get(this.carList1[i].id).returnCount += Math.abs(this.carList1[i]
- .saleDetailQueryDTO[m].productCount)
- } else {
- this.carList.get(this.carList1[i].id).productCount += Number(this.carList1[i]
- .saleDetailQueryDTO[m].productCount)
- }
-
}
+ this.carList.get(this.carList1[i].id).returnList.forEach(function(value, key) {
+ if(value.productCount < 0){
+ that.carList.get(that.carList1[i].id).returnCount += Math.abs(value.productCount)
+ }
+
+ })
+ this.carList.get(this.carList1[i].id).stockLogList.forEach(function(value, key) {
+ if(value.productCount < 0){
+ console.log(that.carList1)
+ console.log(that.carList)
+ that.carList.get(that.carList1[i].id).returnCount += Math.abs(value.productCount)
+ }else{
+ that.carList.get(that.carList1[i].id).productCount += value.productCount
+ }
+ })
} else { //商品不同
+
let obj = {
+ attrId: this.carList1[i].attrId,
purchasePrice: this.carList1[i].purchasePrice, //采购价
price: 0,
discount: 10,
categoryId: this.carList1[i].categoryId,
- discountAmount: this.carList1[i].wholesalePrice || 0,
+ customerCategoryList:this.carList1[i].customerCategoryRule,
+ discountAmount: this.carList1[i].discountAmount>0? this.carList1[i].discountAmount:( this.carList1[i].wholesalePrice || 0),
returnPrice: this.carList1[i].returnPrice ? this.carList1[i].returnPrice : this
.carList1[i].wholesalePrice || 0,
disNoAmount: 0, //折前价,用于计算整体折扣
@@ -1735,10 +2010,36 @@
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
stockLogList: new Map(),
+ returnList: new Map(),
+ returnList1: [],
stockLogList1: [],
productSn: this.carList1[i].productSn,
supplierName: this.carList1[i].supplierName
}
+ console.log(this.khName)
+ console.log(obj)
+ if(this.khName.categoryId != null){
+ if(obj.customerCategoryList != null){
+ for(let i=0;i= 0){
+ // this.carList.get(this.carList1[i].id).productCount += data1.productCount
+ // }else if(data1.productCount < 0){
+ // this.carList.get(this.carList1[i].id).returnCount += Math.abs(data1.productCount)
+ // }
this.carList.get(this.carList1[i].productId).stockLogList.set(this.carList1[i]
.stockLogList1[m].attributeList, data1)
} else { //规格不同
@@ -1877,23 +2208,38 @@
name: this.sliceMsg(this.carList1[i].stockLogList1[m].attributeList),
productNum: this.carList1[i].stockLogList1[m].stockCount
}
+ // if(data1.productCount >= 0){
+ // this.carList.get(this.carList1[i].id).productCount += data1.productCount
+ // }else if(data1.productCount < 0){
+ // this.carList.get(this.carList1[i].id).returnCount += Math.abs(data1.productCount)
+ // }
this.carList.get(this.carList1[i].productId).stockLogList.set(this.carList1[i]
.stockLogList1[m].attributeList, data1)
}
- if (this.carList.get(this.carList1[i].productId).productCount < 0) { //退货数量
- this.carList.get(this.carList1[i].productId).returnCount += Math.abs(this.carList1[
- i].stockLogList1[m].productCount)
- } else {
- this.carList.get(this.carList1[i].productId).productCount += Number(this.carList1[i]
- .stockLogList1[m].productCount)
- }
}
+ this.carList.get(this.carList1[i].productId).returnList.forEach(function(value, key) {
+ if(value.productCount < 0){
+ that.carList.get(that.carList1[i].productId).returnCount += Math.abs(value.productCount)
+ }
+
+ })
+ this.carList.get(this.carList1[i].productId).stockLogList.forEach(function(value, key) {
+ if(value.productCount < 0){
+ console.log(that.carList1)
+ console.log(that.carList)
+ that.carList.get(that.carList1[i].productId).returnCount += Math.abs(value.productCount)
+ }else{
+ that.carList.get(that.carList1[i].productId).productCount += value.productCount
+ }
+ })
} else { //商品不同
let obj = {
+ attrId:this.carList1[i].attrId,
purchasePrice: this.carList1[i].purchasePrice, //采购价
price: 0, //总价
discount: 10, //折扣
categoryId: this.carList1[i].categoryId,
+ customerCategoryList:this.carList1[i].customerCategoryRule != null?JSON.parse(this.carList1[i].customerCategoryRule):null,
categoryName: this.carList1[i].isNew ? '默认分类' : this.carList1[i].categoryName,
productId: this.carList1[i].productId,
isNew: this.carList1[i].isNew,
@@ -1913,9 +2259,33 @@
productPictures: this.carList1[i].productPictures || [],
productSn: this.carList1[i].productSn,
stockLogList: new Map(),
+ returnList: new Map(),
+ returnList1: [],
stockLogList1: [],
supplierName: this.carList1[i].supplierName //供应商
}
+ if(this.khName.categoryId != null){
+ if(obj.customerCategoryList != null){
+ for(let i=0;i {
if (res1.code == 200) {
this.attrList.push(res1.result[num])
@@ -2146,18 +2517,6 @@
}
}).catch((res) => {})
},
- //获取新货号
- getNewSn(img) {
- this.tui.request("/app/productSn/getNewProductSn", "POST", {
- snPre: this.snName
- }, false, true).then((res) => {
- if (res.code == 200) {
- this.addPageGoods(img, res.result)
- } else {
- this.tui.toast(res.message)
- }
- }).catch((res) => {})
- },
addPageGoods(path, sn) {
let obj = {
id: generateUUID(),
@@ -2165,6 +2524,7 @@
categoryId: this.fenleiList.categoryId,
isNew: true,
productPictures: [],
+ customerCategoryRule:null,
purchasePrice: "", //采购价
price: 0, //总价
discount: 10, //折扣
@@ -2181,6 +2541,8 @@
productPicture: '',
productSn: sn ? sn : "",
stockLogList: new Map(),
+ returnList: new Map(),
+ returnList1: [],
stockLogList1: [],
supplierName: '' //供应商
}
@@ -2287,8 +2649,12 @@
}, false, false, true).then((res) => {
if (res.code !== 200) return
- this.xsyId = res.result[0].id
- this.createByName = res.result[0].nickname
+ if (this.xsyId == '') {
+ this.xsyId = uni.getStorageSync('id')
+ this.createByName = uni.getStorageSync('nickname')
+ }
+ // this.xsyId = res.result[0].id
+ // this.createByName = res.result[0].nickname
this.categoryList = res.result.map(item => {
return {
value: item.id,
@@ -2328,6 +2694,37 @@
this.isPlusAndMinus == false
this.temporaryChange()
},
+ allReturnChange(e) {
+ this.allChangeNum = e
+ //监听到输入框改变,给所有的都赋值
+ if (this.isPlusAndMinus == false) {
+ for (var i = 0; i < this.temporaryReturnList.length; i++) {
+ if (this.evalue.length == 0) {
+ this.temporaryReturnList[i].productCount = Number(this.allChangeNum)
+ } else {
+ for (var j = 0; j < this.evalue.length; j++) {
+ if (this.evalue[j] == this.temporaryReturnList[i].name) {
+ this.temporaryReturnList[i].productCount = Number(this.allChangeNum)
+ }
+ }
+ }
+
+ for (var m = 0; m < this.pageOldTemReturnList.length; m++) {
+ if (this.temporaryReturnList[i].attributeList == this.pageOldTemReturnList[m].attributeList) {
+ this.pageOldTemReturnList[m].productCount = Number(this.temporaryReturnList[i].productCount)
+ }
+ }
+ for (var j = 0; j < this.oldTemReturnList.length; j++) {
+ if (this.temporaryReturnList[i].attributeList == this.oldTemReturnList[j].attributeList) {
+ this.oldTemReturnList[j].productCount = Number(this.temporaryReturnList[i].productCount)
+ }
+ }
+ }
+
+ }
+ this.isPlusAndMinus == false
+ this.temporaryReturnChange()
+ },
plusNum() {
this.isPlusAndMinus == true
//监听到点击+的操作,给所有的都+1
@@ -2391,6 +2788,78 @@
this.temporaryChange()
},
+ plusReturnNum() {
+ this.isPlusAndMinus == true
+ //监听到点击+的操作,给所有的都+1
+ for (var i = 0; i < this.temporaryReturnList.length; i++) {
+ if (this.evalue.length == 0) {
+ if (this.temporaryReturnList[i].productCount == undefined) {
+ this.temporaryReturnList[i].productCount = -1
+ } else {
+ if(this.temporaryReturnList[i].productCount+1 > 0){
+ this.temporaryReturnList[i].productCount = 0
+ }else{
+ this.temporaryReturnList[i].productCount++
+ }
+
+ }
+ } else {
+ for (var j = 0; j < this.evalue.length; j++) {
+ if (this.evalue[j] == this.temporaryReturnList[i].name) {
+ if (this.temporaryReturnList[i].productCount == undefined) {
+ this.temporaryReturnList[i].productCount = -1
+ } else {
+ if(this.temporaryReturnList[i].productCount+1 > 0){
+ this.temporaryReturnList[i].productCount = 0
+ }else{
+ this.temporaryReturnList[i].productCount++
+ }
+ }
+ }
+ }
+ }
+
+ for (var m = 0; m < this.pageOldTemReturnList.length; m++) {
+ if (this.temporaryReturnList[i].attributeList == this.pageOldTemReturnList[m].attributeList) {
+ this.pageOldTemReturnList[m].productCount = Number(this.temporaryReturnList[i].productCount)
+ }
+ }
+ for (var j = 0; j < this.oldTemReturnList.length; j++) {
+ if (this.temporaryReturnList[i].attributeList == this.oldTemReturnList[j].attributeList) {
+ this.oldTemReturnList[j].productCount = Number(this.temporaryReturnList[i].productCount)
+ }
+ }
+ }
+ this.temporaryReturnChange()
+ },
+ minusReturnNum() {
+ this.isPlusAndMinus == true
+ //监听到点击-的操作,给所有的都-1
+ for (var i = 0; i < this.temporaryReturnList.length; i++) {
+ if (this.evalue.length == 0) {
+ this.temporaryReturnList[i].productCount--
+ } else {
+ for (var j = 0; j < this.evalue.length; j++) {
+ if (this.evalue[j] == this.temporaryReturnList[i].name) {
+ this.temporaryReturnList[i].productCount--
+ }
+ }
+ }
+
+ for (var m = 0; m < this.pageOldTemReturnList.length; m++) {
+ if (this.temporaryReturnList[i].attributeList == this.pageOldTemReturnList[m].attributeList) {
+ this.pageOldTemReturnList[m].productCount = Number(this.temporaryReturnList[i].productCount)
+ }
+ }
+ for (var j = 0; j < this.oldTemReturnList.length; j++) {
+ if (this.temporaryReturnList[i].attributeList == this.oldTemReturnList[j].attributeList) {
+ this.oldTemReturnList[j].productCount = Number(this.temporaryReturnList[i].productCount)
+ }
+ }
+ }
+
+ this.temporaryReturnChange()
+ },
getScanCodeCategroyId(num) {
this.isOpenId = num == '颜色' ? 0 : 1
this.goodsId = this.goodsDetail.id
@@ -2398,7 +2867,6 @@
this.isBottom = true
},
longPrec(index, value, index1) {
- console.log('删除', index, value, index1)
var that = this;
uni.showModal({
title: "提示",
@@ -2416,6 +2884,110 @@
}
})
},
+ attrReturnNameChange(index, data1, index1) {
+ let that = this;
+ uni.showLoading({
+ title: '加载中...'
+ })
+ this.goodsReturnDetail.attributeList[index].isChecked = !this.goodsReturnDetail.attributeList[index].isChecked;
+ this.goodsReturnDetail.attributeList[index].value[index1].isChecked = !this.goodsReturnDetail.attributeList[index]
+ .value[index1].isChecked;
+
+ this.evalue = []
+ var value = []
+ for (let i = 0, data = this.goodsReturnDetail.attributeList[0].value; i < data.length; i++) {
+ if (data[i].isChecked) {
+ for (let j = 0, dataJ = this.goodsReturnDetail.attributeList[1].value; j < dataJ.length; j++) {
+ var name = ''
+ let value1 = "{"
+
+ name = data[i].value + ' | ' + dataJ[j].value
+ value1 += '"' + '颜色' + '":"' + data[i].value + '",'
+ value1 += '"' + '尺码' + '":"' + dataJ[j].value + '"'
+ value1 += "}"
+ value.push(value1)
+ this.evalue.push(name)
+ }
+ }
+ }
+ if (this.temporaryReturnList.length == 0) {
+ for (var i = 0; i < value.length; i++) {
+ this.attributeList = {
+ attributeList: value[i],
+ productCount: Number(this.temporaryNum),
+ productNum: null,
+ name: this.evalue[i],
+ price: this.purchasePrice
+ }
+ this.temporaryReturnList.push(this.attributeList);
+ }
+ } else {
+ let newProductCount = 0;
+ for (var i = 0; i < value.length; i++) {
+ for (var m = 0; m < this.temporaryReturnList.length; m++) {
+ if (this.temporaryReturnList[m].attributeList == value[i]) {
+ newProductCount = Number(this.temporaryReturnList[m].productCount)
+ }
+ }
+ this.attributeList = {
+ attributeList: value[i],
+ productCount: newProductCount,
+ productNum: null,
+ name: this.evalue[i],
+ price: this.purchasePrice
+ }
+
+ this.newTemReturnList.push(this.attributeList);
+ newProductCount = 0;
+ }
+ for (var i = 0; i < this.oldTemReturnList.length; i++) {
+ let oldAttributeList = '';
+ let oldProductCount = '';
+ let notChcek = true;
+ for (var m = 0; m < this.newTemReturnList.length; m++) {
+ if (this.oldTemReturnList[i].attributeList == this.newTemReturnList[m].attributeList) {
+ this.newTemReturnList[m].productCount = Number(this.oldTemReturnList[i].productCount)
+ notChcek = false;
+ }
+ }
+ if (this.newTemReturnList.length > 0 && notChcek) {
+ this.newTemReturnList.push(this.oldTemReturnList[i]);
+ }
+ }
+
+ for (var i = 0; i < this.pageOldTemReturnList.length; i++) {
+ let oldAttributeList = '';
+ let oldProductCount = '';
+ let notChcek = true;
+ for (var m = 0; m < this.newTemReturnList.length; m++) {
+ if (this.pageOldTemReturnList[i].attributeList == this.newTemReturnList[m].attributeList) {
+ this.newTemReturnList[m].productCount = Number(this.pageOldTemReturnList[i].productCount)
+ notChcek = false;
+ }
+ }
+ if (this.newTemReturnList.length > 0 && notChcek) {
+ this.newTemReturnList.push(this.pageOldTemReturnList[i]);
+ }
+ }
+ }
+ this.$nextTick(() => {
+ for (var i = 0; i < this.temporaryReturnList.length; i++) {
+ for (var m = 0; m < this.pecsList.length; m++) {
+ if (this.temporaryReturnList[i].attributeList == this.pecsList[m].attributeList) {
+ this.temporaryReturnList[i].productNum = this.pecsList[m].stockCount
+ }
+ }
+ }
+ })
+ if (this.newTemReturnList.length != 0) {
+ this.temporaryReturnList = this.newTemReturnList;
+ this.oldTemReturnList = []
+ this.newTemReturnList = []
+ }
+ setTimeout(res => {
+ uni.hideLoading();
+ }, 200)
+ },
attrNameChange(index, data1, index1) {
let that = this;
uni.showLoading({
@@ -2647,6 +3219,14 @@
}
+ },
+ getMonth() {
+ let date = new Date()
+ let year = date.getFullYear().toString() //'年'
+ let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : (date.getMonth() + 1)
+ .toString() //'月'
+ let da = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate().toString() //'日'
+ this.single = year + '-' + month + '-' + da //当天
},
obtainPrice(e, type, num, num1) {
@@ -2669,9 +3249,16 @@
this.keyboard = 'danjishu'
this.keyboardIndex = num
this.showFu = true
+ }else if (type == 'returndanjishu') {
+ this.keyboard = 'returndanjishu'
+ this.keyboardIndex = num
+ this.showFu = true
} else if (type == 'zongjishu') {
this.keyboard = 'zongjishu'
this.showFu = true
+ }else if (type == 'zongReturnjishu') {
+ this.keyboard = 'zongReturnjishu'
+ this.showFu = true
} else if (type == 'danjia') {
this.showPrice = true
this.keyboard = 'danjia'
@@ -2680,6 +3267,10 @@
this.showFu = true
this.keyboard = 'mapdanjishu'
this.keyboardIndex = [num, num1]
+ }else if (type == 'returnmapdanjishu') {
+ this.showFu = true
+ this.keyboard = 'returnmapdanjishu'
+ this.keyboardIndex = [num, num1]
} else {
this.showPrice = true
this.priceOk = ''
@@ -2690,6 +3281,16 @@
this.$forceUpdate()
this.temporaryChange()
},
+ numReturnChange(e, index) {
+ if(e > 0){
+ this.tui.toast('退货数量不能为正数')
+ }else{
+ this.temporaryReturnList[index].productCount = Number(e)
+ this.$forceUpdate()
+ this.temporaryReturnChange()
+ }
+
+ },
mapnumChange(e, id, id1) {
let that = this;
this.carList.get(id).productCount = 0
@@ -2705,6 +3306,10 @@
that.carList.get(id).productCount = Number(that.carList.get(id).productCount) + Number(value.productCount)
}
})
+ this.carList.get(id).returnList.forEach(function(value, key) {
+ that.carList.get(id).returnCount = that.carList.get(id).returnCount + Math.abs(value
+ .productCount)
+ })
this.$nextTick(() => {
// if (that.discountType != 0) { //单品折扣
that.carList.get(id).price = Number(that.carList.get(id).productCount) * that.carList
@@ -2715,14 +3320,45 @@
this.getAllPrice()
})
},
- async mapMinusNum(index) {
- this.temporaryList[index].productCount--
- this.temporaryChange()
- },
+ mapnumReturnChange(e, id, id1) {
+ let that = this;
+ this.carList.get(id).returnCount = 0
+
+ this.carList.get(id).returnList.get(id1).productCount = Number(e)
+
+ this.carList.get(id).returnList.forEach(function(value, key) {
+ if (value.productCount < 0) {
+ that.carList.get(id).returnCount = that.carList.get(id).returnCount + Math.abs(value
+ .productCount)
+ } else {
+ that.carList.get(id).returnCount = 0
+ }
+ })
+ this.$nextTick(() => {
+ this.getAllPrice()
+ })
+ },
+ mapMinusNum(index) {
+ this.temporaryList[index].productCount--
+ this.temporaryChange()
+ },
mapPlusNum(index) {
this.temporaryList[index].productCount++
this.temporaryChange()
},
+ mapMinusReturnNum(index) {
+ this.temporaryReturnList[index].productCount--
+ this.temporaryReturnChange()
+ },
+ mapPlusReturnNum(index) {
+ if(this.temporaryReturnList[index].productCount >=0){
+ this.tui.toast('退货数量不能为正数')
+ return
+ }else{
+ this.temporaryReturnList[index].productCount++
+ }
+ this.temporaryReturnChange()
+ },
async oneMinusNum(index, index1) {
let that = this;
this.carList.get(index).productCount = 0
@@ -2737,6 +3373,11 @@
.productCount)
}
})
+ this.carList.get(index).returnList.forEach(function(value, key) {
+ that.carList.get(index).returnCount = that.carList.get(index).returnCount + Math.abs(value
+ .productCount)
+ })
+
await this.$nextTick(() => {
// if (that.discountType != 0) { //单品折扣
that.carList.get(index).price = Number(that.carList.get(index).productCount) * that.carList
@@ -2760,6 +3401,10 @@
.productCount)
}
})
+ this.carList.get(index).returnList.forEach(function(value, key) {
+ that.carList.get(index).returnCount = that.carList.get(index).returnCount + Math.abs(value
+ .productCount)
+ })
this.$nextTick(() => {
// if (that.discountType != 0) { //单品折扣
that.carList.get(index).price = Number(that.carList.get(index).productCount) * that.carList
@@ -2770,6 +3415,53 @@
this.getAllPrice()
})
},
+ async oneMinusReturnNum(index, index1) {
+ let that = this;
+ this.carList.get(index).returnCount = 0
+ this.carList.get(index).returnList.get(index1).productCount--
+ await this.carList.get(index).returnList.forEach(function(value, key) {
+ if (value.productCount < 0) {
+ that.carList.get(index).returnCount = Number(that.carList.get(index).returnCount) +
+ Math.abs(value.productCount)
+ }
+ })
+ await this.carList.get(index).stockLogList.forEach(function(value, key) {
+ if (value.productCount < 0) {
+ that.carList.get(index).returnCount = that.carList.get(index).returnCount + Math.abs(value
+ .productCount)
+ }
+ })
+ this.$forceUpdate()
+ this.getAllPrice()
+ },
+ onePlusReturnNum(index, index1) {
+ let that = this;
+ this.carList.get(index).returnCount = 0
+ if(this.carList.get(index).returnList.get(index1).productCount+1 > 0){
+ this.tui.toast('退货数量不能为正数')
+ return
+ }else{
+ this.carList.get(index).returnList.get(index1).productCount++
+ }
+
+ this.carList.get(index).returnList.forEach(function(value, key) {
+ if (value.productCount < 0) {
+ that.carList.get(index).returnCount = that.carList.get(index).returnCount + Math.abs(value
+ .productCount)
+ } else if(value.productCount > 0) {
+ that.carList.get(index).returnCount = 0
+ }
+ })
+ this.carList.get(index).stockLogList.forEach(function(value, key) {
+ if (value.productCount < 0) {
+ that.carList.get(index).returnCount = that.carList.get(index).returnCount + Math.abs(value
+ .productCount)
+ }
+ })
+ this.$nextTick(() => {
+ this.getAllPrice()
+ })
+ },
//实收金额失去焦点
changessPrice(e) {
@@ -2806,8 +3498,8 @@
}).catch((res) => {})
},
getText(e){
- this.voiceText = e.detail.value
- },
+ this.voiceText = e.detail.value
+ },
//切换销售员
categoryChange(e) {
for (let i = 0; i < this.categoryList.length; i++) {
@@ -2837,6 +3529,7 @@
convertChineseToArabic(str) {
const chineseNumToArabic = {
'零': 0,
+ '幺': 1,
'一': 1,
'二': 2,
'两': 2,
@@ -2880,11 +3573,12 @@
'时8': '18',
'时9': '19',
};
- const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|井|时间|十件|事件|世间|实践|实件|景|警|颈|括号|付|负|父|名城|名程|名成|明城|上移|时1|时2|时3|时4|时5|时6|时7|时8|时9)/g;
+ const regex = /(幺|零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|井|时间|十件|事件|世间|实践|实件|景|警|颈|括号|付|负|父|名城|名程|名成|明城|上移|时1|时2|时3|时4|时5|时6|时7|时8|时9)/g;
return str.replace(regex, match => chineseNumToArabic[match]);
},
//编辑挂单信息
async setDetail(e) {
+ console.log(this.carList)
if (this.oneGoodsId) {
this.setOneDetail()
return
@@ -2895,9 +3589,18 @@
}
let convertedStr = this.trimWhitespace(this.voiceText);
convertedStr = this.convertChineseToArabic(convertedStr);
+ if(convertedStr.indexOf('数量') == -1 && convertedStr.indexOf('名称') == -1 &&convertedStr.indexOf('单价') == -1 &&convertedStr.indexOf('批发价') == -1){
+ convertedStr = convertedStr + ','
+ }
if (convertedStr.indexOf('点') != -1) {
convertedStr = this.replaceCharAfterNumber(convertedStr, '点', '.')
}
+ if (convertedStr.startsWith("号")) {
+ convertedStr = "货号" + convertedStr.substr(1);
+ }
+ if (!convertedStr.startsWith("货号")) {
+ convertedStr = "货号" + convertedStr;
+ }
if (convertedStr.indexOf('货号,') != -1) {
convertedStr = convertedStr.replace(/货号,/g, '货号')
}
@@ -2973,9 +3676,7 @@
convertedStr = convertedStr.substr(1)
}
- if (convertedStr.startsWith("号")) {
- convertedStr = "货号" + convertedStr.substr(1);
- }
+ console.log('convertedStr',convertedStr)
this.getMsg = convertedStr
let regexCount = /-?\d+/g;
if (this.isQuantityFollowsProductCode(convertedStr) || (convertedStr.indexOf('色') == -1 && convertedStr
@@ -3062,7 +3763,7 @@
let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
productCount: Number(voiceData
- .productCount[0]),
+ .productCount[0]) || 1,
stockCount: null
}
if (res1.result.stock.length > 0) {
@@ -3070,11 +3771,10 @@
.length; i++) {
if (res1.result.stock[i].attributeList ==
'{"颜色":"均色","尺码":"均码"}') {
- console.log("进来了")
data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
productCount: Number(voiceData
- .productCount[0]),
+ .productCount[0]) || 1,
stockCount: res1.result.stock[
i]
.stockCount
@@ -3141,67 +3841,7 @@
} else {
- this.voiceText = ''
- this.voiceText1 = ''
- this.$refs.popup.close()
- console.log('voiceData3070', voiceData)
- if (voiceData.productCount) {
- let regexZCount = /\d+/g;
- voiceData.productCount = voiceData.productCount[0].match(
- regexZCount);
- }
- if (voiceData.wholesalePrice) {
- voiceData.wholesalePrice = this.replaceCharAfterNumber(
- voiceData.wholesalePrice, '块', '.')
- if (voiceData.indexOf('元') != -1) {
- voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '')
- }
- voiceData.wholesalePrice = voiceData.wholesalePrice.replace(
- /[^0-9.]/g, "");
- }
- if (voiceData.wholesalePrice1) {
- voiceData.wholesalePrice1 = this.replaceCharAfterNumber(
- voiceData.wholesalePrice1, '块', '.')
- if (voiceData.wholesalePrice1.indexOf('元') != -1) {
- voiceData.wholesalePrice1 = voiceData.wholesalePrice1.replace(/元/g, '')
- }
- voiceData.wholesalePrice = voiceData.wholesalePrice1.replace(
- /[^0-9.]/g, "");
- }
- let data = {
- id: voiceData.productSn,
- productId: voiceData.productSn,
- productCount: Number(voiceData.productCount[0]) || 0,
- productName: voiceData.productName,
- productSn: voiceData.productSn,
- isNew: true,
- categoryId: this.fenleiList.categoryId,
- categoryName: this.fenleiList.categoryName,
- unitPrice: voiceData.wholesalePrice || 0,
- discountAmount: voiceData.wholesalePrice || 0,
- wholesalePrice: voiceData.wholesalePrice || 0,
- stockLogList1: [{
- attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(voiceData.productCount[
- 0]),
- stockCount: null
- }]
- }
- console.log(data)
- let purchaseDetails = []
- purchaseDetails.push(data)
-
- setTimeout(ress => {
- if (purchaseDetails.length > 0) {
- this.carList1 = purchaseDetails
- this.$nextTick(() => {
- this.AiHandleData()
- })
-
- } else {
- this.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")
- }
- }, 300 * i)
+ this.tui.toast('录入新商品,请点击顶部“新增商品”按钮添加')
}
}
@@ -3224,10 +3864,11 @@
for (let i = 0; i < res.result.data.length; i++) {
let newList = []
if (res.result.data[i].productId == null) {
- res.result.data[i].isNew = true
- res.result.data[i].productId = res.result.data[i].productSn || res
- .result
- .data[i].productName
+ // res.result.data[i].isNew = true
+ // res.result.data[i].productId = res.result.data[i].productSn || res
+ // .result
+ // .data[i].productName
+ break;
} else {
res.result.data[i].isNew = false
}
@@ -3288,11 +3929,12 @@
for (let i = 0; i < res.result.data.length; i++) {
let newList = []
if (res.result.data[i].productId == null) {
- res.result.data[i].isNew = true
- res.result.data[i].productId = res.result.data[i].productSn || res.result
- .data[
- i].productName
+ // res.result.data[i].isNew = true
+ // res.result.data[i].productId = res.result.data[i].productSn || res.result
+ // .data[i].productName
+ break;
} else {
+ res.result.data[i].id = res.result.data[i].productId
res.result.data[i].isNew = false
}
// res.result.data[i].productCount = 0
@@ -3351,6 +3993,9 @@
}
let convertedStr = this.trimWhitespace(this.voiceText);
convertedStr = this.convertChineseToArabic(convertedStr);
+ if(convertedStr.indexOf('数量') == -1 && convertedStr.indexOf('名称') == -1 &&convertedStr.indexOf('单价') == -1 &&convertedStr.indexOf('批发价') == -1){
+ convertedStr = convertedStr + ','
+ }
if (convertedStr.indexOf('点') != -1) {
convertedStr = this.replaceCharAfterNumber(convertedStr, '点', '.')
}
@@ -3399,6 +4044,12 @@
if (convertedStr.indexOf('数量') != -1) {
convertedStr = convertedStr.replace(/数量/g, ',数量:')
}
+ if (convertedStr.startsWith("号")) {
+ convertedStr = "货号" + convertedStr.substr(1);
+ }
+ if (!convertedStr.startsWith("货号")) {
+ convertedStr = "货号" + convertedStr;
+ }
if (convertedStr.indexOf('货号,') != -1) {
convertedStr = convertedStr.replace(/货号,/g, '货号')
}
@@ -3413,20 +4064,15 @@
if (convertedStr.indexOf(',') == 0) {
convertedStr = convertedStr.substr(1)
}
- if (convertedStr.startsWith("号")) {
- convertedStr = "货号" + convertedStr.substr(1);
- }
this.getMsg = convertedStr
let regexCount = /-?\d+/g;
if (this.isQuantityFollowsProductCode(convertedStr) || (convertedStr.indexOf('色') == -1 && convertedStr
.indexOf('码') == -1)) {
try {
- console.log('convertedStr', convertedStr)
const regex = /货号.*?(?=货号|$)/g;
convertedStr = convertedStr.match(regex);
for (let i = 0; i < convertedStr.length; i++) {
let voiceData = this.extractInfo(convertedStr[i] + '。')
- console.log('voiceData', voiceData)
if (voiceData.productSn) {
voiceData.productSn = voiceData.productSn.replace(/[沟勾钩]/g, 'J');
}
@@ -3465,19 +4111,19 @@
if (res1.code == 200) {
let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(voiceData.productCount),
+ productCount: Number(voiceData.productCount) || 1,
stockCount: null
}
+
if (res1.result.stock.length > 0) {
for (let i = 0; i < res1.result.stock
.length; i++) {
if (res1.result.stock[i].attributeList ==
'{"颜色":"均色","尺码":"均码"}') {
- console.log("进来了")
data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
productCount: Number(voiceData
- .productCount),
+ .productCount) || 1,
stockCount: res1.result.stock[i]
.stockCount
}
@@ -3499,11 +4145,35 @@
let id = this.oneGoodsId
if (purchaseDetails.length > 0) {
-
- console.log('this.carList', this
- .carList)
- if (this.carList.get(id).productSn !=
- '') {
+ this.carList.get(id)
+ .customerCategoryList =
+ purchaseDetails[0]
+ .customerCategoryRule != null ?JSON.parse(purchaseDetails[0]
+ .customerCategoryRule):null
+
+ if(this.khName.categoryId != null){
+ if(this.carList.get(id).customerCategoryList != null){
+ for(let i=0;i {
- this.getAllPrice()
+ this.getAmountAndWho()
this.oneGoodsId = ''
})
} else {
@@ -4115,7 +4826,6 @@
this.voiceText = ''
this.voiceText1 = ''
this.$refs.popup.close()
- console.log('voiceData3070', voiceData)
if (voiceData.productCount) {
let regexZCount = /\d+/g;
voiceData.productCount = voiceData.productCount[0].match(
@@ -4144,6 +4854,7 @@
productCount: Number(voiceData.productCount) || 0,
productName: voiceData.productName,
productSn: voiceData.productSn,
+ customerCategoryList:null,
categoryId: this.fenleiList.categoryId,
categoryName: this.fenleiList.categoryName,
unitPrice: voiceData.wholesalePrice || 0,
@@ -4151,11 +4862,10 @@
wholesalePrice: voiceData.wholesalePrice || 0,
stockLogList1: [{
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(voiceData.productCount),
+ productCount: Number(voiceData.productCount) || 1,
stockCount: null
}]
}
- console.log(data)
let purchaseDetails = []
purchaseDetails.push(data)
let id = this.oneGoodsId
@@ -4188,6 +4898,8 @@
if (this.carList.get(id).wholesalePrice == '') {
this.carList.get(id).wholesalePrice =
purchaseDetails[0].wholesalePrice
+ this.carList.get(id).unitPrice =
+ purchaseDetails[0].wholesalePrice
}
if (this.carList.get(id).productCount == '') {
this.carList.get(id).productCount =
@@ -4196,11 +4908,9 @@
if (this.carList.get(id).discountAmount == '') {
this.carList.get(id).discountAmount =
purchaseDetails[0].wholesalePrice
+ this.carList.get(id).unitPrice = purchaseDetails[0].wholesalePrice
}
- if (this.carList.get(id).unitPrice == '') {
- this.carList.get(id).unitPrice = purchaseDetails[0]
- .wholesalePrice
- }
+
if (this.carList.get(id).categoryId == '') {
this.carList.get(id).categoryId = purchaseDetails[
0].categoryId
@@ -4314,7 +5024,7 @@
if (purchaseDetails[0].productId) {
this.carList.get(id).attrId = purchaseDetails[0].attrId
- this.carList.get(id).lsPrice = purchaseDetails[0].lsPrice
+ this.carList.get(id).lsprice = purchaseDetails[0].lsprice
}
this.carList.get(id).wholesalePrice = purchaseDetails[0]
.wholesalePrice
@@ -4322,14 +5032,14 @@
.wholesalePrice
this.carList.get(id).unitPrice = purchaseDetails[0]
.wholesalePrice
- this.carList.get(id).lsPrice = purchaseDetails[0].price
+ this.carList.get(id).lsprice = purchaseDetails[0].price
this.carList.get(id).price = purchaseDetails[0]
.wholesalePrice * Number(purchaseDetails[0].productCount)
let specMap = new Map() //新的临时存放值那个更改过的值的map
this.$nextTick(() => {
this.carList.forEach(function(value, key) {
if (key != value.id) {
- specMap.set(value.id, value)
+ specMap.set(value.productId?value.productId:value.id, value)
} else {
specMap.set(key, value)
}
@@ -4391,7 +5101,7 @@
}
this.$nextTick(() => {
- this.getAllPrice()
+ this.getAmountAndWho()
this.oneGoodsId = ''
})
} else {
@@ -4414,9 +5124,14 @@
let purchaseDetails = res.result.data.purchaseDetails
let id = this.oneGoodsId
if (purchaseDetails.length > 0) {
+ // this.carList.get(id).productCount = 0
+ // this.carList.get(id).returnCount = 0
if (this.carList.get(id).productName == '') {
this.carList.get(id).productName = purchaseDetails[0].productName
}
+
+ this.carList.get(id).customerCategoryList = purchaseDetails[0].customerCategoryRule!= null ? JSON.parse(purchaseDetails[0].customerCategoryRule):null
+
let isTrue = false
this.carList.forEach(function(value, key) {
if (value.productSn == purchaseDetails[0].productSn) {
@@ -4477,8 +5192,30 @@
this.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice
this.carList.get(id).discountAmount = purchaseDetails[0].wholesalePrice
}
- if(purchaseDetails[0].lsPrice > 0){
- this.carList.get(id).lsPrice = purchaseDetails[0].lsPrice
+ if(purchaseDetails[0].lsprice > 0){
+ this.carList.get(id).lsprice = purchaseDetails[0].lsprice
+ }
+ if(this.khName.categoryId != null){
+ if(this.carList.get(id).customerCategoryList != null){
+ for(let i=0;i 0){
@@ -4492,7 +5229,7 @@
this.$nextTick(() => {
this.carList.forEach(function(value, key) {
if (key != value.id) {
- specMap.set(value.id, value)
+ specMap.set(value.productId?value.productId:value.id, value)
} else {
specMap.set(key, value)
}
@@ -4500,8 +5237,7 @@
this.carList = specMap
})
this.$nextTick(() => {
- for (let i = 0; i < purchaseDetails[0].stockLogList1
- .length; i++) {
+ for (let i = 0; i < purchaseDetails[0].stockLogList1.length; i++) {
purchaseDetails[0].stockLogList1[i].name = this.sliceMsg(
purchaseDetails[0].stockLogList1[i].attributeList)
if (this.carList.get(id).stockLogList.size == 0) {
@@ -4524,8 +5260,13 @@
.stockLogList1[i])
}
}
- this.carList.get(id).productCount += Number(
- purchaseDetails[0].stockLogList1[i].productCount)
+
+ if(purchaseDetails[0].stockLogList1[i].productCount > 0){
+ this.carList.get(id).productCount += Number(
+ purchaseDetails[0].stockLogList1[i].productCount)
+ }else{
+ this.carList.get(id).returnCount += Math.abs(purchaseDetails[0].stockLogList1[i].productCount)
+ }
if (this.carList.get(id).stockLogList.get(
'{"颜色":"均色","尺码":"均码"}').productCount == 0 &&
purchaseDetails[0].stockLogList1.length > 0) {
@@ -4533,11 +5274,25 @@
'{"颜色":"均色","尺码":"均码"}')
}
}
+ // this.carList.get(id).returnList.forEach(function(value, key) {
+ // if(value.productCount > 0){
+ // this.carList.get(id).productCount += value.productCount
+ // }else{
+ // this.carList.get(id).returnCount += Math.abs(value.productCount)
+ // }
+ // })
+ // this.carList.get(id).stockLogList.forEach(function(value, key) {
+ // if(value.productCount > 0){
+ // this.carList.get(id).productCount += value.productCount
+ // }else{
+ // this.carList.get(id).returnCount += Math.abs(value.productCount)
+ // }
+ // })
this.carList.get(id).price = Number(this.carList.get(id)
.productCount) * this.carList.get(id).discountAmount
})
this.$nextTick(() => {
- this.getAllPrice()
+ this.getAmountAndWho()
this.oneGoodsId = ''
})
} else {
@@ -4569,6 +5324,7 @@
if (this.carList.get(id).productName == '') {
this.carList.get(id).productName = purchaseDetails[0].productName
}
+ this.carList.get(id).customerCategoryList = purchaseDetails[0].customerCategoryRule!= null ? JSON.parse(purchaseDetails[0].customerCategoryRule):null
let isTrue = false
this.carList.forEach(function(value, key) {
if (value.productSn == purchaseDetails[0].productSn) {
@@ -4626,10 +5382,31 @@
this.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice
this.carList.get(id).discountAmount = purchaseDetails[0].wholesalePrice
}
- if(purchaseDetails[0].lsPrice > 0){
- this.carList.get(id).lsPrice = purchaseDetails[0].lsPrice
+ if(purchaseDetails[0].lsprice > 0){
+ this.carList.get(id).lsprice = purchaseDetails[0].lsprice
+ }
+ if(this.khName.categoryId != null){
+ if(this.carList.get(id).customerCategoryList != null){
+ for(let i=0;i 0){
this.carList.get(id).wholesalePrice = purchaseDetails[0].purchasePrice
@@ -4643,7 +5420,7 @@
this.$nextTick(() => {
this.carList.forEach(function(value, key) {
if (key != value.id) {
- specMap.set(value.id, value)
+ specMap.set(value.productId?value.productId:value.id, value)
} else {
specMap.set(key, value)
}
@@ -4672,8 +5449,12 @@
purchaseDetails[0].stockLogList1[i])
}
}
- this.carList.get(id).productCount += Number(purchaseDetails[0]
- .stockLogList1[i].productCount)
+ if(purchaseDetails[0].stockLogList1[i].productCount > 0){
+ this.carList.get(id).productCount += Number(
+ purchaseDetails[0].stockLogList1[i].productCount)
+ }else{
+ this.carList.get(id).returnCount += Math.abs(purchaseDetails[0].stockLogList1[i].productCount)
+ }
if (this.carList.get(id).stockLogList.get(
'{"颜色":"均色","尺码":"均码"}')) {
if (this.carList.get(id).stockLogList.get(
@@ -4689,7 +5470,7 @@
this.carList.get(id).discountAmount
})
this.$nextTick(() => {
- this.getAllPrice()
+ this.getAmountAndWho()
this.oneGoodsId = ''
})
} else {
@@ -4729,6 +5510,7 @@
})
}
}).catch((res) => {})
+ uni.hideLoading()
},
//扫一扫功能
scanCodeAdd() {
@@ -4799,8 +5581,12 @@
// this.$refs.oneDataPopup.close()
// this.getOneData(oneData)
// },
+ //判断语音是不是只包含数字、字符或英文(针对只说货号的情况)
+ isValidString(str) {
+ var regex = /^[A-Za-z0-9_\-]+$/;
+ return regex.test(str);
+ },
async getOneData(oneData, type) {
- console.log('oneData4666', oneData)
this.tui.request('/app/product/getShareList', "post", {
categoryId: "",
pageNum: 1,
@@ -4810,8 +5596,6 @@
if (res.code == 200) {
if (res.result.records != '') {
if (res.result.records.length > 1) {
-
-
for (let i = 0; i < res.result.records.length; i++) {
if (oneData.wholesalePrice) {
res.result.records[i].wholesalePrice = oneData.wholesalePrice
@@ -4819,9 +5603,12 @@
res.result.records[i].discountAmount = oneData.wholesalePrice
}
- res.result.records[i].productCount = Number(oneData.productCount[0])
+ if(oneData.productCount){
+ res.result.records[i].productCount = Number(oneData.productCount[0])
+ }
+
}
- this.$nextTick(() => {
+ this.$nextTick(() => {
this.moreData.push(res.result.records)
this.oneData = oneData
})
@@ -4830,28 +5617,11 @@
this.voiceText = ''
this.voiceText1 = ''
this.$refs.popup.close();
- // this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId",
- // "POST", {
- // categoryId: res.result.records[0].attrId
- // }, false, true).then((res1) => {
- // if (res1.code == 200) {
let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(oneData.productCount[0]),
+ productCount: oneData.productCount != undefined ? Number(oneData.productCount[0]):1,
stockCount: res.result.records[0].defaultStockCount
}
- // if (res1.result.stock.length > 0) {
- // for (let i = 0; i < res1.result.stock.length; i++) {
- // if (res1.result.stock[i].attributeList ==
- // '{"颜色":"均色","尺码":"均码"}') {
- // console.log("进来了")
- // data.stockCount = res1.result.stock[i].stockCount
-
- // }
- // }
- // } else {
-
- // }
setTimeout(ress => {
res.result.records[0].productId = res.result.records[0]
@@ -4866,18 +5636,9 @@
res.result.records[0].discountAmount = oneData
.wholesalePrice
}
- // if(res.result[0].productCount == '' || ){
- // if(voiceData.productCount < 0){
- // res.result[0].returnCount = voiceData.productCount
- // res.result[0].returnPrice = voiceData.wholesalePrice
- // }else{
- // res.result[0].productCount = voiceData.productCount
- // }
- // }
let purchaseDetails = res.result.records
let id = this.oneGoodsId
- console.log('purchaseDetails4693', purchaseDetails)
if (purchaseDetails.length > 0) {
this.carList1 = purchaseDetails
// this.$nextTick(() => {
@@ -4888,70 +5649,12 @@
this.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")
}
}, 300)
- // } else {
- // this.tui.toast(res1.message)
- // }
- // }).catch((res) => {})
}
} else {
- this.voiceText = ''
- this.voiceText1 = ''
- this.$refs.popup.close()
- console.log('oneData3070', oneData)
- if (oneData.productCount) {
- let regexZCount = /\d+/g;
- oneData.productCount = oneData.productCount[0].match(regexZCount);
- }
- if (oneData.wholesalePrice) {
- oneData.wholesalePrice = this.replaceCharAfterNumber(oneData.wholesalePrice,
- '块', '.')
- if (oneData.wholesalePrice.indexOf('元') != -1) {
- oneData.wholesalePrice = oneData.wholesalePrice.replace(/元/g, '')
- }
- oneData.wholesalePrice = oneData.wholesalePrice.replace(/[^0-9.]/g, "");
- }
- if (oneData.wholesalePrice1) {
- oneData.wholesalePrice1 = this.replaceCharAfterNumber(oneData.wholesalePrice1,
- '块', '.')
- if (oneData.wholesalePrice1.indexOf('元') != -1) {
- oneData.wholesalePrice1 = oneData.wholesalePrice1.replace(/元/g, '')
- }
- oneData.wholesalePrice = oneData.wholesalePrice1.replace(/[^0-9.]/g, "");
- }
- let data = {
- id: oneData.productSn,
- productId: oneData.productSn,
- productCount: Number(oneData.productCount[0]) || 0,
- productName: oneData.productName,
- productSn: oneData.productSn,
- isNew: true,
- categoryId: this.fenleiList.categoryId,
- categoryName: this.fenleiList.categoryName,
- unitPrice: oneData.wholesalePrice || 0,
- discountAmount: oneData.wholesalePrice || 0,
- wholesalePrice: oneData.wholesalePrice || 0,
- stockLogList1: [{
- attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(oneData.productCount[0]),
- stockCount: null
- }]
- }
- console.log(data)
- let purchaseDetails = []
- purchaseDetails.push(data)
-
- setTimeout(ress => {
- if (purchaseDetails.length > 0) {
- this.carList1 = purchaseDetails
- this.AiHandleData()
-
- } else {
- this.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")
- }
- }, 500)
+ this.tui.toast('录入新商品,请点击顶部“新增商品”添加')
}
setTimeout(res => {
@@ -4964,14 +5667,6 @@
}
})
- // this.$nextTick(()=>{
- // console.log('moreData', this.moreData)
- // if (type == true && this.moreData.length > 0) {
- // this.$refs.popup.close()
- // this.$refs.oneDataPopup.open()
- // this.showPopup(0)
- // }
- // })
},
showPopup(index) {
@@ -4979,53 +5674,25 @@
this.showTan = true;
},
clickGetOne(item) {
- console.log('选择了:', item);
-
+ console.log('attrid',item)
// 如果还有下一个弹出层,则显示下一个
if (this.currentPopupIndex + 1 < this.moreData.length) {
this.showTan = false; // 先关闭当前弹出层
this.voiceText = ''
this.voiceText1 = ''
- this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId",
- "POST", {
- categoryId: item.attrId
- }, false, true).then((res1) => {
- if (res1.code == 200) {
let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(item.productCount),
- stockCount: null
- }
- if (res1.result.stock.length > 0) {
- for (let i = 0; i < res1.result.stock.length; i++) {
- if (res1.result.stock[i].attributeList ==
- '{"颜色":"均色","尺码":"均码"}') {
- console.log("进来了")
- data.stockCount = res1.result.stock[i].stockCount
-
- }
- }
- } else {
-
+ productCount: Number(item.productCount) || 1,
+ stockCount: item.defaultStockCount
}
this.$nextTick(() => {
item.productId = item.id
item.stockLogList1 = []
item.stockLogList1.push(data)
-
- // if(res.result[0].productCount == '' || ){
- // if(voiceData.productCount < 0){
- // res.result[0].returnCount = voiceData.productCount
- // res.result[0].returnPrice = voiceData.wholesalePrice
- // }else{
- // res.result[0].productCount = voiceData.productCount
- // }
- // }
let purchaseDetails = item
let id = this.oneGoodsId
- console.log('purchaseDetails4827', purchaseDetails)
if (purchaseDetails) {
this.carList1.push(purchaseDetails)
this.$nextTick(() => {
@@ -5036,10 +5703,6 @@
this.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")
}
})
- } else {
- this.tui.toast(res1.message)
- }
- }).catch((res) => {})
setTimeout(() => {
this.showTan = true; // 再显示下一个弹出层
this.currentPopupIndex += 1;
@@ -5048,46 +5711,21 @@
this.showTan = false; // 如果没有更多弹出层,则关闭最后一个弹出层
this.voiceText = ''
this.voiceText1 = ''
- this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId",
- "POST", {
- categoryId: item.attrId
- }, false, true).then((res1) => {
- if (res1.code == 200) {
+
let data = {
attributeList: '{"颜色":"均色","尺码":"均码"}',
- productCount: Number(item.productCount),
- stockCount: null
- }
- if (res1.result.stock.length > 0) {
- for (let i = 0; i < res1.result.stock.length; i++) {
- if (res1.result.stock[i].attributeList ==
- '{"颜色":"均色","尺码":"均码"}') {
- console.log("进来了")
- data.stockCount = res1.result.stock[i].stockCount
-
- }
- }
- } else {
-
+ productCount: Number(item.productCount) || 1,
+ stockCount: item.defaultStockCount
}
+
this.$nextTick(() => {
item.productId = item.id
item.stockLogList1 = []
item.stockLogList1.push(data)
-
- // if(res.result[0].productCount == '' || ){
- // if(voiceData.productCount < 0){
- // res.result[0].returnCount = voiceData.productCount
- // res.result[0].returnPrice = voiceData.wholesalePrice
- // }else{
- // res.result[0].productCount = voiceData.productCount
- // }
- // }
let purchaseDetails = item
let id = this.oneGoodsId
- console.log('purchaseDetails4888', purchaseDetails)
if (purchaseDetails) {
this.moreData = []
this.carList1.push(purchaseDetails)
@@ -5099,10 +5737,7 @@
this.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确")
}
})
- } else {
- this.tui.toast(res1.message)
- }
- }).catch((res) => {})
+
}
},
//弹出商品规格选择
@@ -5119,12 +5754,14 @@
this.getGategoryList()
this.$refs.typePopup.open()
} else if (type == 'oneGoods') {
+ console.log(id)
this.oneGoodsId = id
this.initRecord();
this.voiceText = ''
this.voiceText1 = ''
this.$refs.popup.open('center')
} else {
+ this.oneGoodsId = ''
this.initRecord();
this.voiceText = ''
this.voiceText1 = ''
@@ -5225,22 +5862,35 @@
this.$refs.SNDialog.open('center')
},
async generateSn(value) {
+ let that = this;
+
await this.tui.request("/app/productSn/getNewProductSn", "POST", {
snPre: value
- }, false, true).then((res) => {
- if (res.code == 200) {
- this.carList.get(this.oneGoodsId).productSn = res.result
- this.$forceUpdate()
+ }, false, true).then((res1) => {
+ if (res1.code == 200) {
+ that.tui.request('/app/product/getByProductSn', "post", {
+ productSn: res1.result
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ if (res.result != '') {
+ that.generateSn(value)
+ } else {
+ that.carList.get(that.oneGoodsId).productSn = res1.result
+ that.$forceUpdate()
+ }
+ }
+ })
} else {
- this.tui.toast(res.message)
+ that.tui.toast(res1.message)
}
}).catch((res) => {})
- await this.$nextTick(() => {
+
+ this.$refs.SNDialog.close()
+ setTimeout(res=>{
this.oneGoodsId = ''
this.numRule = ''
this.prefixRule = ''
- })
- this.$refs.SNDialog.close()
+ },2000)
},
clickGategroy(item) {
this.carList.get(this.productId).categoryName = item.categoryName
@@ -5262,23 +5912,31 @@
sourceType: ['album', 'camera'],
camera: 'back',
success(res) {
- uni.uploadFile({
- url: that.tui.interfaceUrl() + '/upload/file',
- filePath: res.tempFiles[0].tempFilePath,
- name: 'file',
- header: {
- "content-type": "multipart/form-data",
- 'accessToken': that.tui.getToken()
- },
- formData: {},
- success: (uploadFileRes) => {
- that.carList.get(value[0]).productPicture = ''
- let path = JSON.parse(uploadFileRes.data)
- //后端返回的地址,存入图片地址
- that.carList.get(value[0]).productPicture = path.result
- that.$forceUpdate()
+ uni.compressImage({
+ src: res.tempFiles[0].tempFilePath,
+ quality: 50,
+ success: res1 => {
+ uni.uploadFile({
+ url: that.tui.interfaceUrl() + '/upload/file',
+ filePath: res1.tempFilePath,
+ name: 'file',
+ header: {
+ "content-type": "multipart/form-data",
+ 'accessToken': that.tui.getToken()
+ },
+ formData: {},
+ success: (uploadFileRes) => {
+ that.carList.get(value[0]).productPicture = ''
+ let path = JSON.parse(uploadFileRes.data)
+ //后端返回的地址,存入图片地址
+ that.carList.get(value[0]).productPicture = path.result
+ that.$forceUpdate()
+ }
+ });
+
}
- });
+ })
+
}
})
},
@@ -5286,7 +5944,6 @@
this.current = e.detail.current
},
getZhuBigImage(path) {
- console.log(path)
let paths = []
paths.push(path)
uni.previewImage({
@@ -5333,39 +5990,47 @@
async upLoadFile(path, time) {
let that = this;
let hiver_token = uni.getStorageSync("hiver_token")
- await uni.uploadFile({
- url: that.tui.interfaceUrl() + '/upload/file',
- filePath: path,
- name: 'file',
- header: {
- "content-type": "multipart/form-data",
- 'accessToken': hiver_token
- },
- formData: {},
- success: (uploadFileRes) => {
- let pathData = JSON.parse(uploadFileRes.data)
- if (that.childrenId != '') {
- let data = {
- productPicture: pathData.result
+ await uni.compressImage({
+ src: path,
+ quality: 50,
+ success: res1 => {
+
+ uni.uploadFile({
+ url: that.tui.interfaceUrl() + '/upload/file',
+ filePath: res1.tempFilePath,
+ name: 'file',
+ header: {
+ "content-type": "multipart/form-data",
+ 'accessToken': hiver_token
+ },
+ formData: {},
+ success: (uploadFileRes) => {
+ let pathData = JSON.parse(uploadFileRes.data)
+ if (that.childrenId != '') {
+ let data = {
+ productPicture: pathData.result
+ }
+ that.carList.get(that.childrenId).productPictures.push(data)
+ that.$forceUpdate()
+ } else {
+ setTimeout(function() {
+ that.isSnList(pathData.result)
+ }, 100 * time);
+
+ // that.addPageGoods(pathData.result)
+ }
+ },
+ fail: (err) => {
+ uni.hideLoading();
+ uni.showToast({
+ title: JSON.stringify(err),
+ icon: 'none'
+ })
}
- that.carList.get(that.childrenId).productPictures.push(data)
- that.$forceUpdate()
- } else {
- setTimeout(function() {
- that.isSnList(pathData.result)
- }, 100 * time);
-
- // that.addPageGoods(pathData.result)
- }
- },
- fail: (err) => {
- uni.hideLoading();
- uni.showToast({
- title: JSON.stringify(err),
- icon: 'none'
- })
+ });
}
- });
+ })
+
await setTimeout(res => {
uni.hideLoading();
}, 1000)
@@ -5398,9 +6063,11 @@
if (e == '0') { //零售
value.discountAmount = value.lsprice
value.returnPrice = value.lsprice
+ value.unitPrice = value.lsprice
} else { //批发
value.discountAmount = value.wholesalePrice
value.returnPrice = value.wholesalePrice
+ value.unitPrice = value.wholesalePrice
}
}
})
@@ -5421,12 +6088,16 @@
let that = this;
let num = this.carList.get(this.index)
- num.discountAmount = price
+
if (returnPrice != '') {
num.returnPrice = returnPrice
}
- num.unitPrice = price;
- num.price = price * Number(num.productCount);
+ if(price != ''){
+ num.discountAmount = price
+ num.unitPrice = price;
+ num.price = price * Number(num.productCount);
+ }
+
this.$refs.inputDialog.close()
this.$refs.historyPopup.close()
// num.discountAmount = num.unitPrice * num.discount / 10
@@ -5448,28 +6119,35 @@
price = value.disNoAmount
} else {
if (that.priceType == '') {
- price = value.wholesalePrice
+ price = value.discountAmount>0?value.discountAmount: value.wholesalePrice
} else if (that.priceType == 0) { //零售
price = value.lsprice
} else if (that.priceType == 1) { //批发
price = value.wholesalePrice
}
}
- if (value.isNew != true) {
- value.unitPrice = price;
- }
- if (that.discountType == 1) { //整体折扣
- value.discountAmount = value.unitPrice * (that.discountNum / 10)
- value.discountAmount = value.discountAmount.toFixed(2)
- value.price = value.discountAmount * Number(value.productCount)
- value.price = value.price.toFixed(2)
- } else if (that.discountType == 0) { //单品折扣
- value.discountAmount = value.unitPrice * (value.discount / 10)
- value.discountAmount = value.discountAmount.toFixed(2)
+ // if (value.isNew != true) {
+ // value.unitPrice = price;
+ // }
+ if(that.discountType !=''){
+ if (that.discountType == 1) { //整体折扣
+ value.discountAmount = value.unitPrice * (that.discountNum / 10)
+ value.discountAmount = value.discountAmount.toFixed(2)
+ value.price = value.discountAmount * Number(value.productCount)
+ value.price = value.price.toFixed(2)
+ }
+ if (that.discountType == 0) { //单品折扣
+ value.discountAmount = value.unitPrice * (value.discount / 10)
+ value.discountAmount = value.discountAmount.toFixed(2)
+ value.price = (value.unitPrice * (value.discount / 10)) * Number(value.productCount)
+ value.price = value.price.toFixed(2)
+
+ }
+ }else{
value.price = (value.unitPrice * (value.discount / 10)) * Number(value.productCount)
value.price = value.price.toFixed(2)
-
}
+
})
this.getAllPrice();
@@ -5482,6 +6160,9 @@
AiAddSpec(value, current) {
this.getById(value, current);
},
+ AiAddReturnSpec(value) {
+ this.getByReturnId(value);
+ },
//通过商品id查询商品详细信息
async getById(id, current) {
let that = this;
@@ -5620,6 +6301,7 @@
return
}
that.goodsDetail = res.result;
+ that.goodsDetail.unitPrice = that.goodsDetail.wholesalePrice
that.temporaryList = []
this.pageOldTemList = []
if (that.carList.size > 0) {
@@ -5739,6 +6421,135 @@
}).catch((res) => {})
}
},
+ //通过商品id查询商品详细信息
+ async getByReturnId(id) {
+ let that = this;
+ this.pageOldTemReturnList = []
+ await this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => {
+ if (res.code == 200) {
+ if (res.result.delFlag == 0) {
+ that.tui.toast("请将商品上架后再操作!")
+ return
+ }
+ that.goodsReturnDetail = res.result;
+ that.temporaryReturnList = []
+ this.pageOldTemReturnList = []
+ if (that.carList.size > 0) {
+ that.carList.forEach(function(value, key) {
+ value.returnList.forEach(function(values, keys) {
+ if (value.returnList1.length == 0) {
+ let obj = {
+ productCount: Number(values.productCount),
+ name: values.name,
+ attributeList: keys,
+ productNum: values.productNum
+ }
+ value.returnList1.push(obj)
+ } else {
+ for (var i = 0; i < value.returnList1
+ .length; i++) {
+ if (value.returnList1[i].attributeList !=
+ keys) {
+ if (value.returnList1.length == (i +
+ 1)) {
+ let obj = {
+ productCount: Number(values
+ .productCount),
+ name: values.name,
+ attributeList: keys,
+ productNum: values.productNum
+ }
+ value.returnList1.push(obj)
+ }
+ }
+ }
+ }
+ })
+ })
+ that.zReturnNum = 0
+ that.$nextTick(() => {
+ that.carList.forEach(function(value, key) {
+ if (value.productId == id) {
+ that.zReturnNum = Number(value.returnCount)
+ that.temporaryReturnList = value.returnList1
+ that.pageOldTemReturnList = value.returnList1
+ that.oldTemReturnList = value.returnList1
+ }
+ value.returnList1 = []
+ })
+ })
+ }
+ that.$nextTick(() => {
+ this.tui.request(
+ "/app/productAttribute/selectAttributeAndValueByCategoryId",
+ "POST", {
+ categoryId: this.goodsReturnDetail.attrId
+ }, false, true).then((res1) => {
+ if (res1.code == 200) {
+ this.goodsReturnList = []
+ if (typeof(res1.result.attributeAndValue) ==
+ 'string') {
+ let newObj = JSON.parse(res1.result
+ .attributeAndValue)
+ let newArr = []
+ let dataArr = []
+ for (let val in newObj) {
+ let valueObj = [];
+ for (var i = 0; i < newObj[val].length; i++) {
+ valueObj.push({
+ value: newObj[val][i],
+ isChecked: false
+ })
+ this.dataObj.set(newObj[val][i], val)
+ }
+ newArr.push({
+ name: val,
+ value: valueObj
+ })
+ }
+ this.goodsReturnDetail.attributeList = newArr;
+ for (var i = 0; i < this.goodsReturnDetail.attributeList
+ .length; i++) {
+ let oldCheck = false
+ let oldValue = []
+ for (var m = 0; m < this.goodsReturnDetail
+ .attributeList[i].value
+ .length; m++) {
+ if (this.goodsReturnDetail.attributeList[i]
+ .value[m].isChecked ==
+ true) {
+ oldCheck = true
+ oldValue.push(this.goodsReturnDetail
+ .attributeList[i].value[
+ m].value)
+ }
+ }
+ let specs1 = {
+ specs: []
+ }
+ this.goodsReturnList.push(specs1)
+ oldCheck = false
+ oldValue = []
+ }
+ if (this.temporaryReturnList == '') {
+ this.attrReturnNameChange(0, that.goodsReturnDetail
+ .attributeList[0].value[0].value, 0)
+ }
+ } else {
+ this.tui.toast('失败了')
+ }
+ this.getKCReturnList(res1.result.stock)
+ } else {
+ this.tui.toast(res1.message)
+ }
+ }).catch((res) => {})
+ })
+
+ } else {
+ this.tui.toast(res.message)
+ }
+ }).catch((res) => {})
+ },
//库存商品详情
getKCList(list) {
this.yanseList = new Map()
@@ -5775,6 +6586,42 @@
uni.hideLoading();
}, 200)
},
+ //库存商品详情
+ getKCReturnList(list) {
+ this.yanseList = new Map()
+ this.chimaList = new Map()
+ this.$refs.returnDialog.open('bottom')
+ this.pecsList = list
+
+ for (let i = 0; i < list.length; i++) {
+ let attributeList = JSON.parse(list[i].attributeList)
+ Object.keys(attributeList).forEach(key => {
+ if (key == '颜色') {
+ if (this.yanseList.has(attributeList[key]) != true) {
+ this.yanseList.set(attributeList[key], attributeList[key])
+ }
+
+ } else {
+ if (this.chimaList.has(attributeList[key]) != true) {
+ this.chimaList.set(attributeList[key], attributeList[key])
+ }
+ }
+ })
+ }
+ for (let i = 0; i < this.goodsReturnDetail.attributeList[0].value.length; i++) { //颜色
+ if (this.yanseList.has(this.goodsReturnDetail.attributeList[0].value[i].value) == true) {
+ this.goodsReturnDetail.attributeList[0].value[i].isKucun = true
+ }
+ }
+ for (let i = 0; i < this.goodsReturnDetail.attributeList[1].value.length; i++) { //尺码
+ if (this.chimaList.has(this.goodsReturnDetail.attributeList[1].value[i].value) == true) {
+ this.goodsReturnDetail.attributeList[1].value[i].isKucun = true
+ }
+ }
+ setTimeout(res => {
+ uni.hideLoading();
+ }, 200)
+ },
temporaryChange(val, item) {
if (item != '' && item != undefined) {
for (var m = 0; m < this.pageOldTemList.length; m++) {
@@ -5797,6 +6644,28 @@
}
}
},
+ temporaryReturnChange(val, item) {
+ if (item != '' && item != undefined) {
+ for (var m = 0; m < this.pageOldTemReturnList.length; m++) {
+ if (item.attributeList == this.pageOldTemReturnList[m].attributeList) {
+ this.pageOldTemReturnList[m].productCount = Number(item.productCount)
+ break;
+ }
+ }
+ for (var j = 0; j < this.oldTemReturnList.length; j++) {
+ if (item.attributeList == this.oldTemReturnList[j].attributeList) {
+ this.oldTemReturnList[j].productCount = Number(item.productCount)
+ break;
+ }
+ }
+ }
+ this.zReturnNum = 0
+ for (var i = 0; i < this.temporaryReturnList.length; i++) {
+ if (this.temporaryReturnList[i].productCount > 0) {
+ this.zReturnNum += Number(this.temporaryReturnList[i].productCount)
+ }
+ }
+ },
handleBlur(e) {
this.categoryText = e.detail.value
},
@@ -5954,12 +6823,220 @@
}
}
},
+ //弹窗选择规格后,点击退货弹窗中选好了按钮
+ temporaryReturnCheck() {
+ uni.showLoading({
+ title: '加载中...'
+ })
+
+ this.evalue = []
+ let that = this,
+ carList1 = [],
+ newList = []
+ for (let i = 0; i < this.temporaryReturnList.length; i++) {
+ if (this.temporaryReturnList[i].productCount != 0) {
+ newList.push(this.temporaryReturnList[i])
+ }
+ }
+ this.$nextTick(() => {
+ let data = {
+ id: this.goodsReturnDetail.id,
+ price: this.zPrice,
+ num: this.zReturnNum,
+ isNew: this.goodsReturnDetail.isNew,
+ unitPrice: this.goodsReturnDetail.unitPrice,
+ categoryId: this.goodsReturnDetail.categoryId,
+ productName: this.goodsReturnDetail.productName,
+ productSn: this.goodsReturnDetail.productSn,
+ productPicture: this.goodsReturnDetail.productPicture,
+ supplierName: this.goodsReturnDetail.supplierName,
+ saleDetailQueryDTO: newList,
+ wholesalePrice: this.goodsReturnDetail.wholesalePrice,
+ lsprice: this.goodsReturnDetail.price
+ }
+ carList1.push(data)
+ this.temporaryReturnList = []
+ this.oldTemReturnList = []
+ this.purchasePrice = ''
+ this.zPrice = ''
+ this.zReturnNum = ''
+ for (let i = 0; i < this.goodsReturnDetail.attributeList.length; i++) {
+ this.goodsReturnDetail.attributeList[i].isChecked = false;
+ for (let m = 0; m < this.goodsReturnDetail.attributeList[i].value.length; m++) {
+ this.goodsReturnDetail.attributeList[i].value[m].isChecked = false
+ }
+ }
+ if (this.carList.size == 0) { //当前页没有数据
+ for (let i = 0; i < carList1.length; i++) {
+ let obj = {
+ attrId: carList1[i].attrId,
+ purchasePrice: carList1[i].price, //采购价
+ price: 0, //总价
+ discount: 10, //折扣
+ unitPrice: carList1[i].unitPrice || 0, //单价
+ customerCategoryRule:JSON.parse(carList1[i].customerCategoryRule),
+ categoryId: carList1[i].categoryId,
+ discountAmount: carList1[i].isNew ? (carList1[i].unitPrice || 0) : (carList1[i]
+ .wholesalePrice || 0), //折后价
+ returnPrice: carList1[i].wholesalePrice || 0,
+ returnCount: 0,
+ disNoAmount: 0, //折前价,用于计算整体折扣
+ wholesalePrice: carList1[i].wholesalePrice, //批发价
+ lsprice: carList1[i].lsprice, //零售价
+ productCount: 0, //总数量
+ productId: carList1[i].id,
+ productName: carList1[i].productName,
+ productPicture: carList1[i].productPicture,
+ productSn: carList1[i].productSn,
+ stockLogList: new Map(),
+ returnList: new Map(),
+ stockLogList1: [],
+ supplierName: carList1[i].supplierName //供应商
+ }
+ for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
+
+ var data1 = {
+ productCount: Number(carList1[i].saleDetailQueryDTO[m].productCount),
+ name: carList1[i].saleDetailQueryDTO[m].name,
+ productNum: carList1[i].saleDetailQueryDTO[m].productNum
+ }
+ obj.returnList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1)
+ if (carList1[i].saleDetailQueryDTO[m].productCount > 0) {
+ obj.productCount += Number(carList1[i].saleDetailQueryDTO[m].productCount)
+ } else {
+ obj.returnCount += Math.abs(carList1[i].saleDetailQueryDTO[m].productCount)
+ }
+ }
+ this.carList.set(carList1[i].id, obj)
+ }
+ carList1 = []
+
+ } else { //当前页有数据
+ for (let i = 0; i < carList1.length; i++) {
+ if (this.carList.has(carList1[i].id) == true) {
+ this.carList.get(carList1[i].id).returnList = new Map()
+ }
+ if (this.carList.has(carList1[i].id) == true) { //商品相同
+ this.carList.get(carList1[i].id).returnCount = 0
+ this.carList.get(carList1[i].id).returnList.forEach(function(value, key) {
+ if(value.productCount < 0){
+ that.carList.get(carList1[i].id).returnCount += Math.abs(value.productCount)
+ }
+
+ })
+ this.carList.get(carList1[i].id).stockLogList.forEach(function(value, key) {
+ if(value.productCount < 0){
+ that.carList.get(carList1[i].id).returnCount += Math.abs(value.productCount)
+ }
+ })
+ for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
+
+ if (this.carList.get(carList1[i].id).returnList.has(carList1[i]
+ .saleDetailQueryDTO[m].attributeList) == true) { //规格相同
+ var data1 = {
+ productCount: Number(carList1[i].saleDetailQueryDTO[m].productCount),
+ name: carList1[i].saleDetailQueryDTO[m].name,
+ productNum: carList1[i].saleDetailQueryDTO[m].productNum
+ }
+
+ this.carList.get(carList1[i].id).returnList.set(carList1[i]
+ .saleDetailQueryDTO[m].attributeList, data1)
+
+ } else { //规格不同
+ var data1 = {
+ productCount: Number(carList1[i].saleDetailQueryDTO[m].productCount),
+ name: carList1[i].saleDetailQueryDTO[m].name,
+ productNum: carList1[i].saleDetailQueryDTO[m].productNum
+ }
+ this.carList.get(carList1[i].id).returnList.set(carList1[i]
+ .saleDetailQueryDTO[
+ m].attributeList, data1)
+ }
+ if (carList1[i].saleDetailQueryDTO[m].productCount > 0) {
+ this.carList.get(carList1[i].id).productCount += Number(carList1[i]
+ .saleDetailQueryDTO[m].productCount)
+ } else {
+ this.carList.get(carList1[i].id).returnCount += Math.abs(carList1[i]
+ .saleDetailQueryDTO[m].productCount)
+ }
+ that.carList.get(carList1[i].id).returnPay = Number(that.carList.get(carList1[i].id)
+ .returnCount) *
+ that.carList.get(carList1[i].id).unitPrice
+ }
+ } else { //商品不同
+ let obj = {
+ attrId: carList1[i].attrId,
+ purchasePrice: carList1[i].price, //采购价
+ price: 0,
+ discount: 10,
+ customerCategoryRule:JSON.parse(carList1[i].customerCategoryRule),
+ discountAmount: carList1[i].isNew ? (carList1[i].unitPrice || 0) : (
+ carList1[i].wholesalePrice || 0),
+ returnPrice: carList1[i].wholesalePrice || 0,
+ returnCount: 0,
+ disNoAmount: 0, //折前价,用于计算整体折扣
+ unitPrice: carList1[i].unitPrice, //单价
+ categoryId: carList1[i].categoryId,
+ wholesalePrice: carList1[i].wholesalePrice, //批发价
+ lsprice: carList1[i].lsprice, //零售价
+ productCount: 0,
+ productId: carList1[i].id,
+ productName: carList1[i].productName,
+ productPicture: carList1[i].productPicture,
+ stockLogList: new Map(),
+ returnList: new Map(),
+ stockLogList1: [],
+ productSn: carList1[i].productSn,
+ supplierName: carList1[i].supplierName
+ }
+
+ for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
+ var data1 = {
+ productCount: Number(carList1[i].saleDetailQueryDTO[m].productCount),
+ name: carList1[i].saleDetailQueryDTO[m].name,
+ productNum: carList1[i].saleDetailQueryDTO[m].productNum
+ }
+ obj.returnList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1)
+ if (carList1[i].saleDetailQueryDTO[m].productCount > 0) {
+ obj.productCount += Number(carList1[i].saleDetailQueryDTO[m].productCount)
+ } else {
+ obj.returnCount += Math.abs(carList1[i].saleDetailQueryDTO[m].productCount)
+ }
+
+ }
+ this.carList.set(carList1[i].id, obj)
+ }
+ }
+ carList1 = []
+ }
+ this.carList.forEach(function(value, key) {
+ if (value.isNew != true) {
+ if(that.priceType == ''){
+ if(value.returnPrice =='' || value.returnPrice ==null || value.returnPrice ==0){
+ value.returnPrice = value.wholesalePrice
+ }
+
+ }else if (that.priceType == 0) { //零售
+ value.returnPrice = value.lsprice
+ } else if (that.priceType == 1) { //批发
+ value.returnPrice = value.wholesalePrice
+ }
+ }
+
+ })
+ this.getAmountAndWho();
+ this.$refs.returnDialog.close()
+ setTimeout(res => {
+ uni.hideLoading();
+ }, 500)
+ })
+ },
//弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() {
uni.showLoading({
title: '加载中...'
})
-
+
this.evalue = []
let that = this,
carList1 = [],
@@ -5974,6 +7051,7 @@
id: this.goodsDetail.id,
price: this.zPrice,
num: this.zNum,
+ customerCategoryList:this.goodsDetail.customerCategoryRule != null?JSON.parse(this.goodsDetail.customerCategoryRule):"",
isNew: this.goodsDetail.isNew,
unitPrice: this.goodsDetail.unitPrice,
categoryId: this.goodsDetail.categoryId,
@@ -6003,6 +7081,7 @@
purchasePrice: carList1[i].price, //采购价
price: 0, //总价
discount: 10, //折扣
+ customerCategoryList:carList1[i].customerCategoryList,
unitPrice: carList1[i].unitPrice || 0, //单价
categoryId: carList1[i].categoryId,
discountAmount: carList1[i].isNew ? (carList1[i].unitPrice || 0) : (carList1[i]
@@ -6019,11 +7098,35 @@
productPicture: carList1[i].productPicture,
productSn: carList1[i].productSn,
stockLogList: new Map(),
+ returnList: new Map(),
stockLogList1: [],
supplierName: carList1[i].supplierName //供应商
}
+ if(this.khName.categoryId != null){
+ if(obj.customerCategoryList != null){
+ for(let i=0;i {
uni.hideLoading();
- }, 1000)
+ }, 500)
})
},
//是否平台取货
@@ -6224,6 +7359,12 @@
if (convertedStr.indexOf('点') != -1) {
convertedStr = that.replaceCharAfterNumber(convertedStr, '点', '.')
}
+ if (convertedStr.startsWith("号")) {
+ convertedStr = "货号" + convertedStr.substr(1);
+ }
+ if (!convertedStr.startsWith("货号")) {
+ convertedStr = "货号" + convertedStr;
+ }
if (convertedStr.indexOf('货号,') != -1) {
convertedStr = convertedStr.replace(/货号,/g, '货号')
}
@@ -6248,9 +7389,6 @@
if (convertedStr.indexOf(',') == 0) {
convertedStr = convertedStr.substr(1)
}
- if (convertedStr.startsWith("号")) {
- convertedStr = "货号" + convertedStr.substr(1);
- }
convertedStr = convertedStr.replace(/[沟勾钩]/g, 'J');
if (that.voiceText == '' || that.voiceText == null) {
that.voiceText = convertedStr
@@ -6295,6 +7433,11 @@
this.tui.toast('请选择客户!')
return
}
+ if (this.khName.id == '' || this.khName.id == null || this.khName.id == undefined || this.khName.name == '' || this.khName.name == null || this.khName.name == undefined) {
+ this.tui.toast('请选择客户!')
+ return
+ }
+
if (this.xsyId == '') {
this.tui.toast('请选择销售员!')
return
@@ -6358,7 +7501,17 @@
returnSaleDetailList: []
}
}
-
+ var today = new Date();
+ var year = today.getFullYear();
+ var month = today.getMonth() + 1;
+ var day = today.getDate();
+ var formattedMonth = (month < 10 ? '0' : '') + month;
+ var formattedDay = (day < 10 ? '0' : '') + day;
+
+ let dayTime = year + '-' + formattedMonth + '-' + formattedDay
+ if(dayTime != this.single){
+ obj.sale.createTime = this.single + ' 00:00:00'
+ }
let purchaseDetails = [];
let returnList = [];
let ZreturnCount = 0
@@ -6394,6 +7547,25 @@
}
})
+ if(value.returnList.size > 0){
+ value.returnList.forEach(function(res, reskey) {
+ if(res.productCount < 0){
+ let obj1 = {
+ productCount: Math.abs(res.productCount),
+ attributeList: reskey
+ }
+ returnGoods.push(obj1)
+ }else{
+ let obj1 = {
+ productCount: Number(res.productCount),
+ attributeList: reskey
+ }
+ goodsList.push(obj1)
+ }
+
+ })
+ }
+
that.$nextTick(() => {
if (returnGoods.length > 0) {
let data = {
@@ -6502,15 +7674,19 @@
},
hangOrderFn() {
let that = this;
+ uni.showLoading({
+ title: '加载中...'
+ })
this.showPrice1("hang")
uni.showModal({
title: "提示",
content: "挂单后可从首页挂单中查看,是否继续?",
success: function(res) {
- uni.showLoading({
- title: '加载中...'
- })
+
if (res.confirm) {
+ uni.showLoading({
+ title: '加载中...'
+ })
that.sellObj.sale.saleId = that.sellObj.oldSaleId
that.tui.request('/app/sale/temporarySaveSale', "post", that.sellObj, false, false)
.then((res) => {
@@ -6549,29 +7725,34 @@
},1000)
return
}
- let url = ''
- if (this.saleId != '') {
- url = '/app/sale/shareToBuyNew'
- } else {
- url = '/app/sale/buyNew'
- }
- this.tui.request(url, "post", this.sellObj, false, false).then((res) => {
- if (res.code == 200) {
- uni.showToast({
- title: "开单成功",
- icon: 'none'
- })
- setTimeout(res1 => {
- this.$refs.showPopup.close()
- that.clearAll1()
- uni.navigateTo({
- url: '/package1/index/orderDetail?id=' + res.result
- })
- }, 1000)
+ if (this.khName.id == '' || this.khName.id == null || this.khName.id == undefined || this.khName.name == '' || this.khName.name == null || this.khName.name == undefined) {
+ this.tui.toast('请选择客户!')
+ }else{
+ let url = ''
+ if (this.saleId != '') {
+ url = '/app/sale/shareToBuyNew'
} else {
- this.tui.toast(res.message)
+ url = '/app/sale/buyNew'
}
- })
+
+ this.tui.request(url, "post", this.sellObj, false, false).then((res) => {
+ if (res.code == 200) {
+ uni.showToast({
+ title: "开单成功",
+ icon: 'none'
+ })
+ setTimeout(res1 => {
+ this.$refs.showPopup.close()
+ that.clearAll1()
+ uni.navigateTo({
+ url: '/package1/index/orderDetail?id=' + res.result
+ })
+ }, 1000)
+ } else {
+ this.tui.toast(res.message)
+ }
+ })
+ }
setTimeout(res => {
uni.hideLoading();
}, 1000)
@@ -6620,6 +7801,11 @@
this.temporaryList.splice(index, 1);
this.temporaryChange()
},
+ //选商品的时候能删除规格
+ delReturnCarData(index) {
+ this.temporaryReturnList.splice(index, 1);
+ this.temporaryReturnChange()
+ },
//删除整条商品
delShop(id) {
var that = this;
@@ -6674,6 +7860,27 @@
}
})
+ },
+ //删除商品下的某一个规格
+ delShopReturnSpec(id, name) {
+ var that = this;
+ uni.showModal({
+ title: "提示",
+ content: "确定删除此条规格吗?",
+ success: function(res) {
+ if (res.confirm) {
+
+ that.carList.get(id).returnCount -= Math.abs(that.carList.get(id).returnList
+ .get(name).productCount);
+ that.carList.get(id).returnList.delete(name);
+ that.carList.get(id).returtnPay = Number(that.carList.get(id).productCount) * that.carList.get(
+ id).returnPrice
+ that.getAmountAndWho()
+ }
+ that.$forceUpdate()
+ }
+ })
+
},
getCountMethod() {
let that = this;
@@ -6841,12 +8048,12 @@
this.leijiqiankuan = Number(this.zhiqianqiankuan) - Number(this.qiankuandikou) + Number(this.yuedikou) +
Number(this.noPay)
},
- getkhName() {
+ getkhName(name) {
this.tui.request("/app/customer/list", "post", {
notBuyDays: "",
pageNum: 1,
pageSize: 10,
- searchStr: "散客",
+ searchStr: name?name:"散客",
sort: "",
}, false, false).then((res) => {
if (res.code == 200) {
@@ -6854,7 +8061,8 @@
this.khName = {
id: res.result.records[0].id,
name: res.result.records[0].name,
- noEarn: res.result.records[0].noEarn
+ noEarn: res.result.records[0].noEarn,
+ categoryId: res.result.records[0].categoryId
}
this.zhiqianqiankuan = res.result.records[0].noEarn
} else {
@@ -6875,7 +8083,6 @@
that.radioType = '2'
that.discountType = ''
that.pbAddress = ''
- that.zhiqianqiankuan = 0
that.leijiqiankuan = 0
that.qiankuandikou = 0
that.returnPay = 0
@@ -6887,11 +8094,9 @@
that.zPrice = 0
that.zNum = 0
that.shouldPay = 0
- that.khName = {
- id: that.khData.id,
- name: that.khData.name,
- noEarn: null
- } || {}
+ this.getkhName()
+ this.getMonth()
+ that.zhiqianqiankuan = that.khData.noEarn
that.gysName = []
that.wlName = []
that.kdyName = []
@@ -6903,7 +8108,7 @@
that.totalAmount = 0
that.returnTotalAmount = 0
that.saleId = ''
- that.$forceUpdate()
+ that.$forceUpdate()
},
//清空全部数据
clearAll() {
@@ -6927,7 +8132,6 @@
that.discountType = ''
that.discountCurrent = null
that.temporaryList = []
- that.zhiqianqiankuan = 0
that.returnPay = 0
that.qiankuandikou = 0
that.yuedikou = 0
@@ -6937,11 +8141,9 @@
that.zPrice = 0
that.zNum = 0
that.shouldPay = 0
- that.khName = {
- id: that.khData.id,
- name: that.khData.name,
- noEarn: null
- } || {}
+ that.getkhName()
+ that.getMonth()
+ that.zhiqianqiankuan = that.khData.noEarn
that.gysName = []
that.wlName = []
that.kdyName = []
@@ -7176,13 +8378,10 @@
.bottom-box {
width: 100%;
- position: fixed;
- bottom: 0rpx;
display: flex;
background: #fff;
border-top: 1px solid #eee;
- height: 110rpx;
- z-index: 98;
+ height: 10%;
}
.bottom-left {
@@ -7624,8 +8823,7 @@
}
.scroll-content {
- padding-top: 315rpx;
- height: 90%;
+ height: 66%;
}
.kucun {
diff --git a/pages/inventory/inventory.vue b/pages/inventory/inventory.vue
index 973dbad..6f8c92c 100644
--- a/pages/inventory/inventory.vue
+++ b/pages/inventory/inventory.vue
@@ -56,6 +56,10 @@
+
+ 商品数:{{indexList[categoryIndex].count != undefined ? indexList[categoryIndex].count : 0}}
+ 库存数:{{indexList[categoryIndex].stockCount != undefined ? indexList[categoryIndex].stockCount : 0}}
+
@@ -347,7 +351,8 @@
} else {
this.indexList[i].parentId = false
}
- }
+ }
+ this.categoryIndex = index
this.categoryId = this.indexList[index].id
this.pageNum = 1
this.searchName = ""
diff --git a/pages/inventory/inventoryDetail.vue b/pages/inventory/inventoryDetail.vue
index 2f1b0fc..60916dd 100644
--- a/pages/inventory/inventoryDetail.vue
+++ b/pages/inventory/inventoryDetail.vue
@@ -90,57 +90,83 @@
-
-
-
-
- {{item.purchase.createTime}}
-
-
- 操作:{{item.purchase.createByName}}
-
-
-
-
- 供应商
- 数量
- 进货价
- 总价
-
-
- {{item.purchase.supplierName}}
- {{item.purchase.totalAmount}}
- {{type == 0?(item.purchaseDetails[0].purchasePrice==null?0:item.purchaseDetails[0].purchasePrice):0}}
- {{type == 0?item.purchaseDetails[0].zPrice:0}}
-
-
+
+
+
+
+ {{item.createTime}}
+
+
+ 操作:{{item.createByName?item.createByName:''}}
+
+
+
+
+ 客户
+ 数量
+ 退货价
+ 采购价
+
+
+ {{item.userName?item.userName:''}}
+ {{item.returnSaleDetailList[0].productCount?item.returnSaleDetailList[0].productCount:'0'}}
+ {{item.returnSaleDetailList[0].discountAmount?item.returnSaleDetailList[0].discountAmount:'0'}}
+ {{type == 0?(item.returnSaleDetailList[0].purchasePrice?item.returnSaleDetailList[0].purchasePrice:'0'):0}}
+
+
-
-
-
- {{item.createTime}}
-
-
- 操作:{{item.createByName?item.createByName:''}}
-
-
-
-
- 客户
- 数量
- 退货价
- 采购价
-
-
- {{item.userName?item.userName:''}}
- {{item.returnSaleDetailList[0].productCount?item.returnSaleDetailList[0].productCount:'0'}}
- {{item.returnSaleDetailList[0].discountAmount?item.returnSaleDetailList[0].discountAmount:'0'}}
- {{type == 0?(item.returnSaleDetailList[0].purchasePrice?item.returnSaleDetailList[0].purchasePrice:'0'):0}}
-
-
+
+
+
+ {{item.purchase.createTime}}
+
+
+ 操作:{{item.purchase.createByName}}
+
+
+
+
+ 供应商
+ 数量
+ 进货价
+ 总价
+
+
+ {{item.purchase.supplierName}}
+ {{item.purchase.totalAmount}}
+ {{type == 0?(item.purchaseDetails[0].purchasePrice==null?0:item.purchaseDetails[0].purchasePrice):0}}
+ {{type == 0?item.purchaseDetails[0].zPrice:0}}
+
+
+
+
+
+
+
+ {{item.purchase.createTime}}
+
+
+ 操作:{{item.purchase.createByName}}
+
+
+
+
+ 供应商
+ 数量
+ 进货价
+ 总价
+
+
+ {{item.purchase.supplierName}}
+ {{item.purchase.totalAmount}}
+ {{type == 0?(item.purchaseDetails[0].purchasePrice==null?0:item.purchaseDetails[0].purchasePrice):0}}
+ {{type == 0?item.purchaseDetails[0].zPrice:0}}
+
+
+
@@ -291,7 +317,7 @@
GDList:[],
isPrint:false,
bufferData: [],
- items:['库存', '销售明细', '入库明细','退货'],
+ items:['库存', '销售明细', '销售退货','入库明细'],
current: 0,
horizontal: 'right',
pecsList:[],
@@ -386,10 +412,12 @@
var url;
if(this.current==1){ //销售
url = "/app/sale/getSaleListByProductId"
- }else if(this.current==2){ //入库
- url = "/app/purchase/getPurchaseListByProductId"
- }else if(this.current==3){ //退货
+ }else if(this.current==2){ //销售退货
url = "/app/return/getReturnSaleListByProductId"
+ }else if(this.current==3){ //入库
+ url = "/app/purchase/getPurchaseListByProductId"
+ }else if(this.current==4){ //退货
+ url = "/app/purchase/getPurchaseListByProductId"
}
this.tui.request(url, "post", {
productId: this.dataList.id,
@@ -410,23 +438,26 @@
this.detailList[i].lirun = 0
this.detailList[i].productCount = 0
for(let m=0;m{
- this.tui.toast(res.message)
- },1000)
- this.getCaptchaImg()
-
+ this.getCaptchaImg()
+ },1000)
}
}).catch((res) => {
@@ -233,9 +232,12 @@
success: function (res1) {
if(that.wayValue ==1){
that.tui.request("/app/logitics/chooseCompany", "POST", {
- companyId: item.id
+ companyId: item.id,
+ username:item.username
}, false, true).then((res) => {
- if (res.code == 200) {
+ if (res.code == 200) {
+ uni.setStorageSync('username',res.result.logiticsCompany.username)
+ uni.setStorageSync('mobile',res.result.logiticsCompany.mobile)
uni.setStorageSync("hiver_token", res.result.lcomToken)
uni.setStorageSync("transCompany", res.result.logiticsCompany.id)
uni.setStorageSync("isOnLine", res.result.logiticsCompany.isOnLine)
@@ -246,7 +248,7 @@
that.tui.toast('登录成功', 2000, true)
setTimeout(() => {
uni.reLaunch({
- url: '/package1/other/logistics'
+ url: '/package1/other/newLogisticsIndex'
})
}, 200)
} else {