diff --git a/pages/.DS_Store b/pages/.DS_Store
index a1cf89b..29d6b61 100644
Binary files a/pages/.DS_Store and b/pages/.DS_Store differ
diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue
index 4a67d0d..4688e56 100644
--- a/pages/billing/changeGoods1.vue
+++ b/pages/billing/changeGoods1.vue
@@ -102,7 +102,7 @@
- {{item.name}} 库存:{{item.productNum}}
+ {{item.name}} 库存:{{item.productNum}}
@@ -230,7 +230,8 @@
onLoad() {
this.height = wx.getSystemInfoSync().windowHeight
this.getGategoryList()
- this.storageType = uni.getStorageSync('type')
+ this.storageType = uni.getStorageSync('type')
+ uni.setStorageSync('clearMsg','1')
},
methods: {
//初始化获取分类列表
@@ -451,7 +452,6 @@
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.carList1 = this.carList
- prevPage.$vm.clearMsg = '1'
uni.navigateBack({
delta: 1
})
@@ -647,7 +647,11 @@
this.goodsDetail.price = this.temporaryList[0].price = val
},
//弹窗选择规格后,点击弹窗中选好了按钮
- temporaryCheck() {
+ temporaryCheck() {
+ if(this.temporaryList == ''){
+ this.tui.toast("请选择规格!")
+ return;
+ }
let data = {
id: this.goodsDetail.id,
price: this.zPrice,
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 6a0469b..5902c0f 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -15,7 +15,7 @@
{{waitCount.waitAddProductCount > 99 ? '99+' :waitCount.waitAddProductCount}}
-
+
挂单
{{waitCount.registrationCount > 99 ? '99+' :waitCount.registrationCount}}
diff --git a/pages/index/peopleList.vue b/pages/index/peopleList.vue
index ebe85bc..3d5d4e5 100644
--- a/pages/index/peopleList.vue
+++ b/pages/index/peopleList.vue
@@ -168,6 +168,7 @@
this.popleType = options.popleType
this.noClick = options.noClick || 0
this.companyType = options.companyType || ''
+ uni.setStorageSync('clearMsg','1')
if(options.khName){
this.khName = JSON.parse(options.khName) || ''
}
@@ -323,7 +324,6 @@
} else if (this.popleType == 'kdyName') {
prevPage.$vm.kdyName = item
}
- prevPage.$vm.clearMsg = '1'
uni.navigateBack({
delta: 1
})
diff --git a/pages/inventory/.DS_Store b/pages/inventory/.DS_Store
index c6b6969..46e298b 100644
Binary files a/pages/inventory/.DS_Store and b/pages/inventory/.DS_Store differ
diff --git a/pages/inventory/AIInventory.vue b/pages/inventory/AIInventory.vue
index d96d438..84bf1be 100644
--- a/pages/inventory/AIInventory.vue
+++ b/pages/inventory/AIInventory.vue
@@ -46,19 +46,30 @@
{{value[1].productCount}}
- 品名:
- 货号:
+
+ 品名:
+
+
+
+ 货号:
+
+
分类: {{value[1].categoryName}}
- 单价:
-
- 添加规格
-
+ 单价:
+
-
+
+ 批发价:
+ 零售价:
+
+
+
+ 添加规格
+
@@ -187,14 +198,10 @@
-
-
-
-
+
-
-
+
{{item.categoryName}}
@@ -211,6 +218,11 @@
+
+
+
+
+
+ 添加规格
维护采购价
-
+
@@ -596,6 +599,14 @@
this.allChangeNum = 0
this.getById(id);
}
+ },
+ AiAddSpec(value){
+ console.log(value)
+ if(value.categoryId == ''){
+ this.tui.toast('请先选择商品分类')
+ return;
+ }
+ this.getById(value.productId);
},
//通过商品id查询商品详细信息
getById(id) {
@@ -1024,7 +1035,7 @@
console.log(purchaseDetails)
console.log(purchase)
uni.navigateTo({
- url: '/pages/inventory/inventoryConfirm?purchase=' + JSON.stringify(purchase) + '&purchaseDetails=' + JSON.stringify(purchaseDetails)
+ url: '/package1/inventory/inventoryConfirm?purchase=' + JSON.stringify(purchase) + '&purchaseDetails=' + JSON.stringify(purchaseDetails)
})
},
//编辑每一个的单价
diff --git a/pages/inventory/changeGoods1.vue b/pages/inventory/changeGoods1.vue
index f3e342a..bf63c9f 100644
--- a/pages/inventory/changeGoods1.vue
+++ b/pages/inventory/changeGoods1.vue
@@ -686,8 +686,9 @@
id: this.goodsDetail.id,
price: this.zPrice,
num: this.zNum,
+ productId:this.goodsDetail.id,
wholesalePrice: this.goodsDetail.wholesalePrice,
- price: this.goodsDetail.price,
+ price: this.goodsDetail.purchasePrice,
productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture,
diff --git a/pages/inventory/gategory.vue b/pages/inventory/gategory.vue
deleted file mode 100644
index 527b540..0000000
--- a/pages/inventory/gategory.vue
+++ /dev/null
@@ -1,811 +0,0 @@
-
-
-
-
-
-
-
- -
-
- {{item.categoryName}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/inventory/gategoryLow.vue b/pages/inventory/gategoryLow.vue
deleted file mode 100644
index 15af60f..0000000
--- a/pages/inventory/gategoryLow.vue
+++ /dev/null
@@ -1,552 +0,0 @@
-
-
-
-
-
- -
-
- {{items.attributeName}}
-
-
-
-
-
-
-
- {{item.value}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue
index 72cac65..f783167 100644
--- a/pages/inventory/goodsList1.vue
+++ b/pages/inventory/goodsList1.vue
@@ -33,7 +33,7 @@
-
+
AI开单
@@ -53,19 +53,22 @@
暂无图片
{{value[1].productName}} ({{value[1].productSn}})
- 单价:{{value[1].discountAmount}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}
+ ¥{{value[1].discountAmount}} * {{value[1].productCount}} 总价:{{value[1].price}}
供应商:{{value[1].supplierName}}
-
- 改价
+
+ 改价
+
+
+ 添加规格
+
+ style="position: absolute;top: 120rpx;right: 160rpx;">
-
+
@@ -88,16 +91,25 @@
数量
+
+
+
+ 规格
+ 库存
+
+ 数量
- {{values[0] | sliceMsg}}
+ {{values[0] | sliceMsg}}
+ {{values[1].productNum}}
- 数量:
+
+
@@ -235,7 +247,7 @@
placeholder="请选择配送方式" @change="checkBoxChange">
-
{{radioType == '1'? '快递员' :'拉包工'}}
@@ -377,34 +389,32 @@
-
-
-
+
语音识别中...
@@ -565,7 +575,8 @@
newTemList: [],
pecsList: [],
dataObj: new Map(),
- allChangeNum:0
+ allChangeNum:0,
+ recordState:false
}
},
components: {
@@ -598,7 +609,6 @@
value: 1
}]
}
- console.log('商品', this.carList1)
if (uni.getStorageSync('carList1') != '') {
this.carList.clear()
this.carList1 = JSON.parse(uni.getStorageSync('carList1'))
@@ -610,163 +620,15 @@
} else {
this.carList1 = this.carList1
}
- if (this.carList1 == '' && this.clearMsg != '1' && !uni.getStorageSync('saoma')) {
+ if (this.carList1 == '' && !uni.getStorageSync('clearMsg') && !uni.getStorageSync('saoma')) {
this.carList.clear()
this.remark = ''
- this.clearMsg = '';
this.createByName = ''
this.xsyId = ''
this.khName = []
this.saleId = ''
}
- for (let i = 0; i < this.carList1.length; i++) {
- // if(that.priceType == 0){ //零售
- // this.afterPrice += this.carList1[i].lsprice
- // }else if(that.priceType == 1){ //批发
- // this.afterPrice += this.carList1[i].wholesalePrice
- // }
- // if (that.discountType == 1) { //整体折扣
- // this.afterPrice = this.afterPrice * 10000 * that.discountNum / 10 / 10000
- // }
-
- if (this.carList1[i].saleDetailQueryDTO) {
- if (this.carList.size == 0) { //当前页没有数据
-
- let obj = {
- purchasePrice: this.carList1[i].price, //采购价
- price: 0, //总价
- discount: 10, //折扣
- unitPrice: this.carList1[i].unitPrice || 0, //单价
- discountAmount: this.carList1[i].unitPrice || 0, //折后价
- wholesalePrice: this.carList1[i].wholesalePrice, //批发价
- lsprice: this.carList1[i].lsprice, //零售价
- productCount: 0, //总数量
- productId: this.carList1[i].id,
- productName: this.carList1[i].productName,
- productPicture: this.carList1[i].productPicture,
- productSn: this.carList1[i].productSn,
- stockLogList: new Map(),
- stockLogList1: [],
- supplierName: this.carList1[i].supplierName //供应商
- }
- for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
- var data1 = {
- productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
- name: this.carList1[i].saleDetailQueryDTO[m].name
- }
- obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
- obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
- }
- this.carList.set(this.carList1[i].id, obj)
- } else { //当前页有数据
- if (this.carList.has(this.carList1[i].id) == true) { //商品相同
- for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
- if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i]
- .saleDetailQueryDTO[
- m].attributeList) == true) { //规格相同
-
- var data1 = {
- productCount: this.carList.get(this.carList1[i].id).stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList).productCount + this.carList1[i].saleDetailQueryDTO[m].productCount,
- name: this.carList1[i].saleDetailQueryDTO[m].name
- }
-
- 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: this.carList1[i].saleDetailQueryDTO[m].productCount,
- name: this.carList1[i].saleDetailQueryDTO[m].name
- }
- this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
- m].attributeList, data1)
- }
- this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[
- m].productCount
- }
- } else { //商品不同
- let obj = {
- purchasePrice: this.carList1[i].price, //采购价
- price: 0,
- discount: 10,
- discountAmount: this.carList1[i].unitPrice || 0,
- unitPrice: this.carList1[i].unitPrice || 0, //单价
- wholesalePrice: this.carList1[i].wholesalePrice, //批发价
- lsprice: this.carList1[i].lsprice, //零售价
- productCount: 0,
- productId: this.carList1[i].id,
- productName: this.carList1[i].productName,
- productPicture: this.carList1[i].productPicture,
- stockLogList: new Map(),
- stockLogList1: [],
- productSn: this.carList1[i].productSn,
- supplierName: this.carList1[i].supplierName
- }
- for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
- // obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
- // .saleDetailQueryDTO[m].productCount)
- // obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
- var data1 = {
- productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
- name: this.carList1[i].saleDetailQueryDTO[m].name
- }
- obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
-
- obj.name = this.carList1[i].saleDetailQueryDTO[m].name
- obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
- }
- this.carList.set(this.carList1[i].id, obj)
- }
- }
- }
-
- }
- uni.removeStorageSync('carList1')
- uni.removeStorageSync('khName')
- uni.removeStorageSync('saoma')
- this.carList1 = []
- this.carList.forEach(function(value, key) {
- if (that.priceType == '') {
- // value.unitPrice = value.unitPrice
- } else if (that.priceType == 0) { //零售
- value.unitPrice = value.lsprice
- } else if (that.priceType == 1) { //批发
- value.unitPrice = value.wholesalePrice
- }
- if (that.discountType == 1) { //整体折扣
- value.price = value.unitPrice * 10000 * value.productCount * that.discountNum / 10 / 10000
- }
- })
- this.getAllPrice()
- this.getAmountAndWho()
- // this.noPay = this.shouldPay
- if (this.xsyId == '') {
- this.xsyId = uni.getStorageSync('id')
- this.createByName = uni.getStorageSync('nickname')
- }
- if(this.carList1 != ''){
- setTimeout(res => {
- uni.hideLoading();
- }, 2000)
- }else{
- setTimeout(res => {
- uni.hideLoading();
- }, 300)
- }
-
- console.log(this.carList)
+ this.handleData()
},
filters: {
sliceMsg(val) {
@@ -785,7 +647,267 @@
this.xsyList();
this.initRecord();
},
- methods: {
+ methods: {
+ handleData(){
+ let that = this;
+ console.log(this.carList1)
+ for (let i = 0; i < this.carList1.length; i++) {
+
+ if (this.carList1[i].saleDetailQueryDTO) {
+ if (this.carList.size == 0) { //当前页没有数据
+
+ let obj = {
+ purchasePrice: this.carList1[i].price, //采购价
+ price: 0, //总价
+ discount: 10, //折扣
+ unitPrice: this.carList1[i].unitPrice || 0, //单价
+ discountAmount: this.carList1[i].unitPrice || 0, //折后价
+ wholesalePrice: this.carList1[i].wholesalePrice, //批发价
+ lsprice: this.carList1[i].lsprice, //零售价
+ productCount: 0, //总数量
+ productId: this.carList1[i].id,
+ productName: this.carList1[i].productName,
+ productPicture: this.carList1[i].productPicture,
+ productSn: this.carList1[i].productSn,
+ stockLogList: new Map(),
+ stockLogList1: [],
+ supplierName: this.carList1[i].supplierName //供应商
+ }
+ for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
+ var data1 = {
+ productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
+ name: this.carList1[i].saleDetailQueryDTO[m].name,
+ productNum:this.carList1[i].saleDetailQueryDTO[m].productNum
+ }
+ obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
+ obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
+ }
+ this.carList.set(this.carList1[i].id, obj)
+ } else { //当前页有数据
+ if (this.carList.has(this.carList1[i].id) == true) { //商品相同
+ for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
+ if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i]
+ .saleDetailQueryDTO[
+ m].attributeList) == true) { //规格相同
+
+ var data1 = {
+ productCount: this.carList.get(this.carList1[i].id).stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList).productCount + this.carList1[i].saleDetailQueryDTO[m].productCount,
+ name: this.carList1[i].saleDetailQueryDTO[m].name
+ }
+
+ 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: this.carList1[i].saleDetailQueryDTO[m].productCount,
+ name: this.carList1[i].saleDetailQueryDTO[m].name
+ }
+ this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
+ m].attributeList, data1)
+ }
+ this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[
+ m].productCount
+ }
+ } else { //商品不同
+ let obj = {
+ purchasePrice: this.carList1[i].price, //采购价
+ price: 0,
+ discount: 10,
+ discountAmount: this.carList1[i].unitPrice || 0,
+ unitPrice: this.carList1[i].unitPrice || 0, //单价
+ wholesalePrice: this.carList1[i].wholesalePrice, //批发价
+ lsprice: this.carList1[i].lsprice, //零售价
+ productCount: 0,
+ productId: this.carList1[i].id,
+ productName: this.carList1[i].productName,
+ productPicture: this.carList1[i].productPicture,
+ stockLogList: new Map(),
+ stockLogList1: [],
+ productSn: this.carList1[i].productSn,
+ supplierName: this.carList1[i].supplierName
+ }
+ for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
+ // obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
+ // .saleDetailQueryDTO[m].productCount)
+ // obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
+ var data1 = {
+ productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
+ name: this.carList1[i].saleDetailQueryDTO[m].name,
+ productNum:this.carList1[i].saleDetailQueryDTO[m].productNum
+ }
+ obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
+
+ obj.name = this.carList1[i].saleDetailQueryDTO[m].name
+ obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
+ }
+ this.carList.set(this.carList1[i].id, obj)
+ }
+ }
+ }
+
+ }
+ uni.removeStorageSync('carList1')
+ uni.removeStorageSync('khName')
+ uni.removeStorageSync('saoma')
+ uni.removeStorageSync('clearMsg')
+
+ this.carList1 = []
+ this.carList.forEach(function(value, key) {
+ if (that.priceType == '') {
+ // value.unitPrice = value.unitPrice
+ } else if (that.priceType == 0) { //零售
+ value.unitPrice = value.lsprice
+ } else if (that.priceType == 1) { //批发
+ value.unitPrice = value.wholesalePrice
+ }
+ if (that.discountType == 1) { //整体折扣
+ value.price = value.unitPrice * 10000 * value.productCount * that.discountNum / 10 / 10000
+ }
+ })
+ this.getAllPrice()
+ this.getAmountAndWho()
+ // this.noPay = this.shouldPay
+ if (this.xsyId == '') {
+ this.xsyId = uni.getStorageSync('id')
+ this.createByName = uni.getStorageSync('nickname')
+ }
+ if(this.carList1 != ''){
+ setTimeout(res => {
+ uni.hideLoading();
+ }, 2000)
+ }else{
+ setTimeout(res => {
+ uni.hideLoading();
+ }, 300)
+ }
+ },
+ AiHandleData(){
+ let that = this;
+ for (let i = 0; i < this.carList1.length; i++) {
+
+ if (this.carList1[i].stockLogList1) {
+ if (this.carList.size == 0) { //当前页没有数据
+
+ let obj = {
+ purchasePrice: this.carList1[i].purchasePrice, //采购价
+ price: 0, //总价
+ discount: 10, //折扣
+ unitPrice: this.carList1[i].price || 0, //单价
+ discountAmount: this.carList1[i].unitPrice || 0, //折后价
+ wholesalePrice: this.carList1[i].wholesalePrice, //批发价
+ lsprice: this.carList1[i].price, //零售价
+ productCount: this.carList1[i].productCount, //总数量
+ id: this.carList1[i].productId,
+ productName: this.carList1[i].productName,
+ productPicture: this.carList1[i].productPicture,
+ productSn: this.carList1[i].productSn,
+ stockLogList: new Map(),
+ stockLogList1: [],
+ supplierName: this.carList1[i].supplierName //供应商
+ }
+ for (let m = 0; m < this.carList1[i].stockLogList1.length; m++) {
+ var data1 = {
+ productCount: this.carList1[i].stockLogList1[m].productCount,
+ name: this.carList1[i].stockLogList1[m].name,
+ productNum:this.carList1[i].stockLogList1[m].productNum
+ }
+ obj.stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1)
+ obj.productCount += this.carList1[i].stockLogList1[m].productCount
+ }
+ this.carList.set(this.carList1[i].productId, obj)
+ } else { //当前页有数据
+ if (this.carList.has(this.carList1[i].productId) == true) { //商品相同
+ for (let m = 0; m < this.carList1[i].stockLogList1.length; m++) {
+ if (this.carList.get(this.carList1[i].productId).stockLogList.has(this.carList1[i]
+ .stockLogList1[
+ m].attributeList) == true) { //规格相同
+
+ var data1 = {
+ productCount: this.carList.get(this.carList1[i].productId).stockLogList.get(this.carList1[i].stockLogList1[m].attributeList).productCount + this.carList1[i].stockLogList1[m].productCount,
+ name: this.carList1[i].stockLogList1[m].name
+ }
+
+ this.carList.get(this.carList1[i].productId).stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1)
+ } else { //规格不同
+
+ var data1 = {
+ productCount: this.carList1[i].stockLogList1[m].productCount,
+ name: this.carList1[i].stockLogList1[m].name
+ }
+ this.carList.get(this.carList1[i].productId).stockLogList.set(this.carList1[i].stockLogList1[
+ m].attributeList, data1)
+ }
+ this.carList.get(this.carList1[i].productId).productCount += this.carList1[i].stockLogList1[
+ m].productCount
+ }
+ } else { //商品不同
+ let obj = {
+ purchasePrice: this.carList1[i].purchasePrice, //采购价
+ price: 0, //总价
+ discount: 10, //折扣
+ unitPrice: this.carList1[i].price || 0, //单价
+ discountAmount: this.carList1[i].unitPrice || 0, //折后价
+ wholesalePrice: this.carList1[i].wholesalePrice, //批发价
+ lsprice: this.carList1[i].price, //零售价
+ productCount: this.carList1[i].productCount, //总数量
+ id: this.carList1[i].productId,
+ productName: this.carList1[i].productName,
+ productPicture: this.carList1[i].productPicture,
+ productSn: this.carList1[i].productSn,
+ stockLogList: new Map(),
+ stockLogList1: [],
+ supplierName: this.carList1[i].supplierName //供应商
+ }
+ for (let m = 0; m < this.carList1[i].stockLogList1.length; m++) {
+ // obj.stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, this.carList1[i]
+ // .stockLogList1[m].productCount)
+ // obj.productCount += this.carList1[i].stockLogList1[m].productCount
+ var data1 = {
+ productCount: this.carList1[i].stockLogList1[m].productCount,
+ name: this.carList1[i].stockLogList1[m].name,
+ productNum:this.carList1[i].stockLogList1[m].productNum
+ }
+ obj.stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1)
+
+ obj.name = this.carList1[i].stockLogList1[m].name
+ obj.productCount += this.carList1[i].stockLogList1[m].productCount
+ }
+ this.carList.set(this.carList1[i].productId, obj)
+ }
+ }
+ }
+
+ }
+
+ this.carList1 = []
+ this.carList.forEach(function(value, key) {
+ if (that.priceType == '') {
+ // value.unitPrice = value.unitPrice
+ } else if (that.priceType == 0) { //零售
+ value.unitPrice = value.lsprice
+ } else if (that.priceType == 1) { //批发
+ value.unitPrice = value.wholesalePrice
+ }
+ if (that.discountType == 1) { //整体折扣
+ value.price = value.unitPrice * 10000 * value.productCount * that.discountNum / 10 / 10000
+ }
+ })
+ this.getAllPrice()
+ this.getAmountAndWho()
+ },
//保存已选
saveCheck() {
this.pageOldTemList = this.temporaryList
@@ -992,13 +1114,9 @@
this.relPrice = e.target.value
this.noPay = this.relPrice - this.priceOk;
},
- changePrice(e) {
- console.log(e)
- console.log(e.target.value)
- console.log(this.relPrice)
+ changePrice(e) {
e.detail.value = e.detail.value > this.relPrice ? this.relPrice : e.detail.value
this.priceOk = e.detail.value
- console.log(this.priceOk)
this.$forceUpdate()
this.noPay = this.relPrice - this.priceOk;
@@ -1043,6 +1161,8 @@
if (res.code == 200) {
this.voiceText = ''
this.$refs.popup.close()
+ this.carList1 = res.result
+ this.AiHandleData()
} else {
this.tui.toast(res.message)
}
@@ -1120,7 +1240,6 @@
title: '加载中...'
})
} else {
- wx.vibrateShort()
this.initRecord();
this.voiceText = ' '
this.$refs.popup.open(type)
@@ -1195,7 +1314,13 @@
that.noPay = this.relPrice - this.priceOk
}
},
-
+ AiAddSpec(value){
+ if(value.categoryId == ''){
+ this.tui.toast('请先选择商品分类')
+ return;
+ }
+ this.getById(value.productId);
+ },
//通过商品id查询商品详细信息
getById(id) {
let that = this;
@@ -1243,8 +1368,6 @@
that.zNum = 0
that.$nextTick(() => {
that.carList.forEach(function(value, key) {
- console.log('是否相同',value)
- console.log(id)
if (value.productId == id) {
that.zNum = value.productCount
that.temporaryList = value.stockLogList1
@@ -1448,7 +1571,7 @@
return
}
let companyType = this.radioType == 1 ? this.wlName.id : ''
-
+ console.log(this.khName)
uni.navigateTo({
url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType +
'&khName=' + JSON.stringify(this.khName)
@@ -1508,7 +1631,8 @@
var data1 = {
productCount: carList1[i].saleDetailQueryDTO[m].productCount,
- name: carList1[i].saleDetailQueryDTO[m].name
+ name: carList1[i].saleDetailQueryDTO[m].name,
+ productNum:carList1[i].saleDetailQueryDTO[m].productNum
}
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount
@@ -1518,10 +1642,11 @@
carList1 = []
} else { //当前页有数据
-
+ console.log(carList1)
+ console.log(this.carList)
for (let i = 0; i < carList1.length; i++) {
- this.carList.get(carList1[i].id).productCount = 0
if (this.carList.has(carList1[i].id) == true) { //商品相同
+ this.carList.get(carList1[i].id).productCount = 0
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
if (this.carList.get(carList1[i].id).stockLogList.has(carList1[i]
.saleDetailQueryDTO[
@@ -1580,7 +1705,8 @@
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
var data1 = {
productCount: carList1[i].saleDetailQueryDTO[m].productCount,
- name: carList1[i].saleDetailQueryDTO[m].name
+ name: carList1[i].saleDetailQueryDTO[m].name,
+ productNum:carList1[i].saleDetailQueryDTO[m].productNum
}
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount
@@ -1625,6 +1751,7 @@
//按住语音识别,开始
kaishi() {
this.recordState = true
+ uni.vibrateShort();
manager.start({
duration: 60000,
lang: "zh_CN"
@@ -1681,7 +1808,6 @@
uni.showLoading({
title: '加载中...'
})
- console.log(this.carList)
if (this.khName == '') {
this.tui.toast('请选择客户!')
return
@@ -2067,8 +2193,7 @@
},
//删除商品下的某一个规格
delShopSpec(id, name) {
- var that = this;
- console.log(that.carList)
+ var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
@@ -2099,19 +2224,14 @@
that.shouldPay = that.shouldPay + value.price
that.totalAmount = that.totalAmount + value.productCount
})
- console.log(this.shouldPay)
- this.relPrice = this.shouldPay
- console.log(this.relPrice)
+ this.relPrice = this.shouldPay
this.$forceUpdate()
that.noPay = this.relPrice - (this.priceOk == '' ? 0 : this.priceOk)
},
//修改已选规格的数量
GoodsNumChange(e, index, index1) {
- let that = this;
- console.log(index[0])
- console.log(index1)
- console.log(this.carList)
+ let that = this;
this.carList.get(index[0]).stockLogList.get(index1).productCount = e
this.carList.get(index[0]).productCount = 0
this.carList.get(index[0]).stockLogList.forEach(function(value, key) {
@@ -2716,6 +2836,7 @@
justify-content: center;
flex-flow: column;
position: fixed;
+ top:50%;
left: 50%;
background: rgba(0, 0, 0, 0.5);
border-radius: 20rpx;
diff --git a/pages/inventory/inventory.vue b/pages/inventory/inventory.vue
index f4bad14..a2a45f9 100644
--- a/pages/inventory/inventory.vue
+++ b/pages/inventory/inventory.vue
@@ -253,7 +253,7 @@
onGridClick(target) {
if (target == '0') {
uni.navigateTo({
- url: '/pages/inventory/gategory'
+ url: '/package1/inventory/gategory'
})
} else if (target == '1') {
uni.navigateTo({
diff --git a/pages/inventory/inventoryConfirm.vue b/pages/inventory/inventoryConfirm.vue
deleted file mode 100644
index b890542..0000000
--- a/pages/inventory/inventoryConfirm.vue
+++ /dev/null
@@ -1,285 +0,0 @@
-
-
-
-
-
-
-
-
-
- 暂无图片
-
- {{item.productName == null ?'暂无':item.productName}}
- 货号:{{item.productSn == null ?'暂无':item.productSn}}
- 单价:{{item.purchasePrice == null ?'暂无':item.purchasePrice}} 数量:{{item.productCount == null ?'暂无':item.productCount}} 总价:{{item.price == null ?'暂无':item.price}}
-
-
-
-
- {{items.attributeList | sliceMsg}}
-
- 数量:{{items.productCount == null ?'暂无':items.productCount}}
-
-
-
-
-
- 应付金额
-
- ¥
- {{ purchase.shouldPay == null ?'暂无':purchase.shouldPay }}
-
-
-
- 已付金额
-
- ¥
- {{ purchase.alreadyPay == null ?'暂无':purchase.alreadyPay }}
-
-
-
- 欠款
-
- ¥
- {{ purchase.noPay == null ?'暂无':purchase.noPay}}
-
-
-
- 其他费用
-
- ¥
- {{ purchase.otherPay == null ?'暂无':purchase.otherPay}}
-
-
-
- 备注
-
-
- {{ sales.remark == null ?'':sales.remark}}
- 查看更多
-
-
-
-
-
-
- 批量打印
- 确认提交
-
-
-
-
-
-
-
\ No newline at end of file