wangfukang 3 years ago
parent
commit
0d568b48c7
  1. 231
      pages/billing/changeGoods1.vue
  2. 38
      pages/index/addHangOrder.vue
  3. 10
      pages/index/downStearmList.vue
  4. 8
      pages/index/order.vue
  5. 161
      pages/inventory/changeGoods1.vue
  6. 138
      pages/inventory/goodsList1.vue
  7. 15
      pages/other/logistics.vue

231
pages/billing/changeGoods1.vue

@ -130,34 +130,34 @@
<!-- 购物车弹出层 -->
<uni-popup ref="carPopup" background-color="#fff" @change="change">
<view class="popup-content">
<view v-for="(item,index) in carList" :key="index" style="position: relative;">
<view v-for="(value,key) in Array.from(newList)" :key="key" style="position: relative;">
<view class="popup-title">
<view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png"
alt="">
</view>
<view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view>
<view class="popup-title-right-box">{{item.productSn}}</view>
<view class="popup-title-right-box" style="color: #088FEB;">{{value[1].productName}}</view>
<view class="popup-title-right-box">{{value[1].productSn}}</view>
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle">
<text style="margin-right:20rpx;">¥{{item.price}}</text>
<text style="margin-right:20rpx;">¥{{value[1].price}}</text>
<!-- <uni-icons color="#088FEB" type="compose" size="16"></uni-icons> -->
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(item.id)">
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[1].id)">
<uni-icons color="red" type="trash" size="26"></uni-icons>
</view>
</view>
</view>
</view>
<view class="popup-container" v-for="(items,index1) in item.saleDetailQueryDTO" :key="index1">
<view class="popup-container" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key="keys">
<view class="checkList">
<view style="margin-right:5%;" @tap="delShopSpec(items.name)">
<view style="margin-right:5%;" @tap="delShopSpec(value[0],values[0])">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
{{items.name}}
{{values[0] | sliceMsg}}
</view>
<uni-number-box max="100000" v-model="items.productCount" @change="change" />
<uni-number-box max="100000" v-model="values[1]" @change="change" />
</view>
</view>
</view>
@ -203,9 +203,30 @@
zNum: 0,
storageType: '',
carNum: 0,
carType: 0,
type:'',
carType: 0,
type: '',
oldList: [],
newList: new Map()
}
},
filters: {
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
},
maxNum(val) {
if (val >= 10) {
return 10
} else if (val < 0) {
return 0
}
}
},
onLoad() {
this.getGategoryList()
@ -225,7 +246,7 @@
} else {
this.indexList[i].parentId = false
}
}
}
this.categoryId = this.indexList[0].id
this.getShareList(this.indexList[0].id);
} else {
@ -337,9 +358,13 @@
toggle(type, item) {
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (type == 'carPopup') {
console.log(this.carList)
this.oldList = this.carList
this.newFun()
this.carNum = 0
for (let i = 0; i < this.carList.length; i++) {
this.carNum += this.carList[i].num
}
}
this.$refs.carPopup.open('bottom')
this.carType = this.carList.length
} else {
@ -348,6 +373,73 @@
}
},
newFun() {
//newList 已经是map格式了 新数组 初始为空
//carList 旧数组
for (let i = 0; i < this.carList.length; i++) {
if (this.newList.size == 0) { //首次放值,直接放就行
let obj = {
purchasePrice: this.carList[i].price, //采购价
price: 0, //总价
discount: 10, //折扣
unitPrice: 0, //单价
discountAmount: 0, //折后价
wholesalePrice: this.carList[i].wholesalePrice, //批发价
lsprice: this.carList[i].lsprice, //零售价
productCount: 0, //总数量
productId: this.carList[i].id,
productName: this.carList[i].productName,
productPicture: this.carList[i].productPicture,
productSn: this.carList[i].productSn,
stockLogList: new Map(),
stockLogList1: [],
supplierName: this.carList[i].supplierName //供应商
}
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i]
.saleDetailQueryDTO[m].productCount)
}
this.newList.set(this.carList[i].id, obj)
} else { //不是首次,里面有值
if (this.newList.has(this.carList[i].id) == true) { //商品相同 ,给循环,判断规格是不是相同
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
if (this.newList.get(this.carList[i].id).stockLogList.has(this.carList[i]
.saleDetailQueryDTO[m].attributeList) == true) { //规格相同
this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.newList.get(this.carList[i].id).stockLogList.get(this.carList[i].saleDetailQueryDTO[m].attributeList) + this.carList[i].saleDetailQueryDTO[m].productCount)
} else { //规格不同
this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i]
.saleDetailQueryDTO[m])
}
}
} else { //商品不同,可以直接给map.set
let obj = {
purchasePrice: this.carList[i].price, //采购价
price: 0,
discount: 10,
discountAmount: 0,
unitPrice: 0, //单价
wholesalePrice: this.carList[i].wholesalePrice, //批发价
lsprice: this.carList[i].lsprice, //零售价
productCount: 0,
productId: this.carList[i].id,
productName: this.carList[i].productName,
productPicture: this.carList[i].productPicture,
stockLogList: new Map(),
stockLogList1: [],
productSn: this.carList[i].productSn,
supplierName: this.carList[i].supplierName
}
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i]
.saleDetailQueryDTO[m].productCount)
obj.productCount += this.carList[i].saleDetailQueryDTO[m].productCount
}
this.newList.set(this.carList[i].id, obj)
}
}
}
},
//选择商品查询商品规格
checkGoods(item) {
this.tui.request("/app/product/getById/" + item.id, "POST", {}, false, true).then((res) => {
@ -392,22 +484,22 @@
},
//顶部搜索框
search(res) {
this.searchName = res.value
this.searchName = res.value
this.getShareList()
},
//未入库遮罩
clickMask(item){
let title = ''
if(item.delFlag == 0){
title = '请将商品上架后再操作!'
}
// else if(item.delFlag == 1){
// title = '请将商品入库后再操作!'
// }
uni.showToast({
title: title,
icon: 'none'
})
},
//未入库遮罩
clickMask(item) {
let title = ''
if (item.delFlag == 0) {
title = '请将商品上架后再操作!'
}
// else if(item.delFlag == 1){
// title = '请将商品入库后再操作!'
// }
uni.showToast({
title: title,
icon: 'none'
})
},
//点击左侧菜单切换
clickLeftBtn(index) {
@ -417,7 +509,7 @@
} else {
this.indexList[i].parentId = false
}
}
}
this.categoryId = this.indexList[index].id
this.getShareList(this.indexList[index].id)
},
@ -430,12 +522,6 @@
},
//弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() {
// if(this.storageType == 0 && this.purchasePrice == 0){
// uni.showToast({
// title: "请输入采购价!",
// icon: 'none'
// })
// }else{
let data = {
id: this.goodsDetail.id,
price: this.zPrice,
@ -445,11 +531,19 @@
productPicture: this.goodsDetail.productPicture,
supplierName: this.goodsDetail.supplierName,
saleDetailQueryDTO: this.temporaryList,
saleDetailQueryDTO1: [],
wholesalePrice: this.goodsDetail.wholesalePrice,
lsprice: this.goodsDetail.price
}
}
this.carList.push(data)
for (let i = 0; i < this.carList.length; i++) {
this.carList[i].num = 0
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
this.carList[i].num += this.carList[i].saleDetailQueryDTO[m].productCount
}
}
console.log(this.carList)
this.temporaryList = []
this.purchasePrice = ''
this.zPrice = ''
@ -461,45 +555,40 @@
}
}
this.$refs.popup.close()
// }
},
//删除整条商品
delShop(id) {
var that = this;
console.log(this.carList)
for (let i = 0; i < this.carList.length; i++) {
if (this.carList[i].id == id) {
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
that.carList.splice(i, 1)
}
})
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
if (that.newList.has(id) == true) {
that.newList.delete(id)
}
}
that.$forceUpdate()
}
}
})
},
//删除商品下的某一个规格
delShopSpec(name) {
var that = this;
console.log(this.carList)
for (let i = 0; i < this.carList.length; i++) {
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
if (this.carList[i].saleDetailQueryDTO[m].name == name) {
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
that.carList[i].saleDetailQueryDTO.splice(m, 1)
if (that.carList[i].saleDetailQueryDTO.length == 0) {
that.carList.splice(i, 1)
}
}
})
}
}
}
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
that.newList.get(id).stockLogList.delete(name)
if (that.newList.get(id).stockLogList.size == 0) {
that.newList.delete(id)
}
}
that.$forceUpdate()
}
})
},
//选择是零售价还是批发价
checkPay(price) {
@ -689,7 +778,7 @@
}
.content-right {
// width: 550rpx;
// width: 550rpx;
flex: 1;
overflow-y: scroll;
}
@ -859,9 +948,9 @@
.shop-mask {
width: 100%;
height: 190rpx;
position: absolute;
top: 0;
left: 0;
position: absolute;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.1);
}
</style>

38
pages/index/addHangOrder.vue

@ -539,19 +539,21 @@
uni.showModal({
title: "提示",
content: "确定删除此条挂单记录吗?",
success: function(res) {
that.tui.request("/app/sale/delById", "POST", {
id: id
}, false, false).then((res) => {
if (res.code == 200) {
that.tui.toast("删除成功")
that.getRegList();
} else {
that.tui.toast(res.message)
success: function(res) {
if (res.confirm) {
that.tui.request("/app/sale/delById", "POST", {
id: id
}, false, false).then((res) => {
if (res.code == 200) {
that.tui.toast("删除成功")
that.getRegList();
} else {
that.tui.toast(res.message)
}
}).catch((res) => {
that.tui.toast(res)
})
}
}).catch((res) => {
that.tui.toast(res)
})
}
})
},
@ -563,14 +565,16 @@
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
success: function(res) {
if (res.confirm) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
if (item.saleDetailDTOList[i].productId == productId) {
item.saleDetailDTOList.splice(item.saleDetailDTOList[i], 1)
}
}
that.carList = item.saleDetailDTOList
that.setSaleDetail();
that.setSaleDetail();
}
}
})
},
@ -582,11 +586,13 @@
uni.showModal({
title: "提示",
content: "确定删除此条规格吗?",
success: function(res) {
success: function(res) {
if (res.confirm) {
item.saleDetailDTOList[index].stockLogList1.splice(item.saleDetailDTOList[index]
.stockLogList1[index1], 1)
that.carList = item.saleDetailDTOList
that.setSaleDetail();
that.setSaleDetail();
}
}
})
},

10
pages/index/downStearmList.vue

@ -430,8 +430,10 @@
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
that.carList.splice(i, 1)
success: function(res) {
if (res.confirm) {
that.carList.splice(i, 1)
}
}
})
}
@ -447,10 +449,12 @@
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
success: function(res) {
if (res.confirm) {
that.carList[i].stockLogList1.splice(m, 1)
if (that.carList[i].stockLogList1.length == 0) {
that.carList.splice(i, 1)
}
}
}
})

8
pages/index/order.vue

@ -1,8 +1,9 @@
<template>
<view>
<view class="search">
<view class="search">
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" type="daterange" />
<u-search placeholder="输入收货人/货号/商品名称/供应商查询" v-model="keyword" @search="searchList" bg-color="#fff"
:show-action="false" border-color="#afd9ee"></u-search>
:show-action="false" style="margin-top:10px;" border-color="#afd9ee"></u-search>
</view>
<view class="ulList" v-if="inventoryList.length > 0">
<ul>
@ -135,9 +136,8 @@
width: 100%;
background-color: #fff;
}
.ulList {
margin-top: 120upx;
margin-top: 200upx;
ul {
li {

161
pages/inventory/changeGoods1.vue

@ -114,32 +114,32 @@
<!-- 购物车弹出层 -->
<uni-popup ref="carPopup" background-color="#fff" @change="change">
<view class="popup-content">
<view v-for="item in carList" style="position: relative;">
<view v-for="(value,key) in Array.from(newList)" :key="key" style="position: relative;">
<view class="popup-title">
<view class="popup-title-left">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/c09dfa8c61c949f8b0dbb8f041d5a501.png" alt="">
</view>
<view class="popup-title-right">
<view class="popup-title-right-box" style="color: #088FEB;">{{item.productName}}</view>
<view class="popup-title-right-box">{{item.productSn}}</view>
<view class="popup-title-right-box" style="color: #088FEB;">{{value[1].productName}}</view>
<view class="popup-title-right-box">{{value[1].productSn}}</view>
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle">
<text style="margin-right:20rpx;">¥{{item.price}}</text>
<text style="margin-right:20rpx;">¥{{value[1].price}}</text>
<!-- <uni-icons color="#088FEB" type="compose" size="16"></uni-icons> -->
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(item.id)">
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[1].id)">
<uni-icons color="red" type="trash" size="26"></uni-icons>
</view>
</view>
</view>
</view>
<view class="popup-container" v-for="items in item.saleDetailQueryDTO">
<view class="popup-container" v-for="(values,keys) in Array.from(value[1].stockLogList)" :key="keys">
<view class="checkList">
<view style="margin-right:5%;" @tap="delShopSpec(items.name)">
<view style="margin-right:5%;" @tap="delShopSpec(value[0],values[0])">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
{{items.name}}
{{values[0] | sliceMsg}}
</view>
<uni-number-box max="100000" v-model="items.productCount" @change="change" />
<uni-number-box max="100000" v-model="values[1]" @change="change" />
</view>
</view>
</view>
@ -184,8 +184,29 @@
zNum:0,
storageType:0,
carNum:0,
carType:0
carType:0,
oldList: [],
newList: new Map()
}
},
filters: {
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
},
maxNum(val) {
if (val >= 10) {
return 10
} else if (val < 0) {
return 0
}
}
},
onLoad() {
this.getGategoryList()
@ -315,17 +336,87 @@
this.type = type
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (type == 'carPopup') {
this.$refs.carPopup.open('bottom')
this.oldList = this.carList
this.newFun()
this.carNum = 0
for (let i=0;i<this.carList.length;i++) {
this.carNum += this.carList[i].num
}
this.carType = this.carList.length
this.carType = this.carList.length
this.$refs.carPopup.open('bottom')
} else {
this.checkGoods(item);
this.$refs.popup.open('bottom')
}
},
newFun() {
//newList 已经是map格式了 新数组 初始为空
//carList 旧数组
for (let i = 0; i < this.carList.length; i++) {
if (this.newList.size == 0) { //首次放值,直接放就行
let obj = {
purchasePrice: this.carList[i].price, //采购价
price: 0, //总价
discount: 10, //折扣
unitPrice: 0, //单价
discountAmount: 0, //折后价
wholesalePrice: this.carList[i].wholesalePrice, //批发价
lsprice: this.carList[i].lsprice, //零售价
productCount: 0, //总数量
productId: this.carList[i].id,
productName: this.carList[i].productName,
productPicture: this.carList[i].productPicture,
productSn: this.carList[i].productSn,
stockLogList: new Map(),
stockLogList1: [],
supplierName: this.carList[i].supplierName //供应商
}
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i]
.saleDetailQueryDTO[m].productCount)
}
this.newList.set(this.carList[i].id, obj)
} else { //不是首次,里面有值
if (this.newList.has(this.carList[i].id) == true) { //商品相同 ,给循环,判断规格是不是相同
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
if (this.newList.get(this.carList[i].id).stockLogList.has(this.carList[i]
.saleDetailQueryDTO[m].attributeList) == true) { //规格相同
this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.newList.get(this.carList[i].id).stockLogList.get(this.carList[i].saleDetailQueryDTO[m].attributeList) + this.carList[i].saleDetailQueryDTO[m].productCount)
} else { //规格不同
this.newList.get(this.carList[i].id).stockLogList.set(this.carList[i]
.saleDetailQueryDTO[m])
}
}
} else { //商品不同,可以直接给map.set
let obj = {
purchasePrice: this.carList[i].price, //采购价
price: 0,
discount: 10,
discountAmount: 0,
unitPrice: 0, //单价
wholesalePrice: this.carList[i].wholesalePrice, //批发价
lsprice: this.carList[i].lsprice, //零售价
productCount: 0,
productId: this.carList[i].id,
productName: this.carList[i].productName,
productPicture: this.carList[i].productPicture,
stockLogList: new Map(),
stockLogList1: [],
productSn: this.carList[i].productSn,
supplierName: this.carList[i].supplierName
}
for (let m = 0; m < this.carList[i].saleDetailQueryDTO.length; m++) {
obj.stockLogList.set(this.carList[i].saleDetailQueryDTO[m].attributeList, this.carList[i]
.saleDetailQueryDTO[m].productCount)
obj.productCount += this.carList[i].saleDetailQueryDTO[m].productCount
}
this.newList.set(this.carList[i].id, obj)
}
}
}
},
//选择商品查询商品规格
checkGoods(item) {
@ -446,37 +537,35 @@
//删除整条商品
delShop(id){
var that = this;
for (let i=0;i<this.carList.length;i++) {
if(this.carList[i].id == id){
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
that.carList.splice(i,1)
}
})
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
if (that.newList.has(id) == true) {
that.newList.delete(id)
}
}
that.$forceUpdate()
}
}
})
},
//删除商品下的某一个规格
delShopSpec(name){
var that = this;
for (let i=0;i<this.carList.length;i++) {
for (let m=0;m<this.carList[i].saleDetailQueryDTO.length;m++) {
if(this.carList[i].saleDetailQueryDTO[m].name == name){
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
that.carList[i].saleDetailQueryDTO.splice(m,1)
if(that.carList[i].saleDetailQueryDTO.length == 0){
that.carList.splice(i,1)
}
}
})
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
that.newList.get(id).stockLogList.delete(name)
if (that.newList.get(id).stockLogList.size == 0) {
that.newList.delete(id)
}
}
that.$forceUpdate()
}
}
})
}
}
}

138
pages/inventory/goodsList1.vue

@ -181,7 +181,7 @@
</radio-group>
</view>
</view>
<view class="">
<view class="" v-if="radioType != '2'">
<view class="content-list" v-if="radioType == '0' || radioType == '1'">
<view class="list-name" style="width:150rpx;padding-left: 0;">
{{radioType == '0'? '选择物流' :'选择快递'}}</view>
@ -390,10 +390,6 @@
value: '1',
name: '快递'
},
// {
// value: '2',
// name: '自送'
// },
{
value: '3',
name: '拼包'
@ -401,6 +397,10 @@
{
value: '4',
name: '发车'
},
{
value: '2',
name: '自提'
},
],
discountType: '', //折扣类型
@ -460,72 +460,27 @@
this.saleId = ''
}
this.totalAmount = 0;
this.shouldPay = 0
if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < this.carList1.length; i++) {
let obj = {
purchasePrice: this.carList1[i].price, //采购价
price: 0, //总价
discount: 10, //折扣
unitPrice: 0, //单价
discountAmount: 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++) {
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
.saleDetailQueryDTO[m].productCount)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(this.carList1[i].id, obj)
}
uni.removeStorageSync('carList1')
uni.removeStorageSync('khName')
this.carList1 = []
} else { //当前页有数据
for (let i = 0; i < this.carList1.length; i++) {
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) { //规格相同
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
}
}
} else { //商品不同
this.shouldPay = 0
for (let i = 0; i < this.carList1.length; i++) {
if (this.carList.size == 0) { //当前页没有数据
let obj = {
purchasePrice: this.carList1[i].price, //采购价
price: 0,
discount: 10,
discountAmount: 0,
price: 0, //总价
discount: 10, //折扣
unitPrice: 0, //单价
discountAmount: 0, //折后价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].lsprice, //零售价
productCount: 0,
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: [],
productSn: this.carList1[i].productSn,
supplierName: this.carList1[i].supplierName
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]
@ -533,12 +488,59 @@
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(this.carList1[i].id, obj)
}
}
uni.removeStorageSync('carList1')
this.carList1 = []
uni.removeStorageSync('carList1')
uni.removeStorageSync('khName')
this.carList1 = []
} 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) { //规格相同
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
}
}
} else { //商品不同
let obj = {
purchasePrice: this.carList1[i].price, //采购价
price: 0,
discount: 10,
discountAmount: 0,
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
}
this.carList.set(this.carList1[i].id, obj)
}
uni.removeStorageSync('carList1')
this.carList1 = []
}
}
this.carList.forEach(function(value, key) {
if (that.priceType == 0) { //零售
@ -1257,7 +1259,8 @@
uni.showModal({
title: "提示",
content: "确定清空全部已选商品吗?",
success: function(res) {
success: function(res) {
if (res.confirm) {
that.carList.clear()
that.remark = ''
that.temporaryList = []
@ -1276,7 +1279,8 @@
that.totalAmount = 0
that.createByName = ''
that.xsyId = ''
this.saleId = ''
this.saleId = ''
}
}
})
}

15
pages/other/logistics.vue

@ -1,7 +1,10 @@
<template>
<view>
<view>
<view>
<button size="default" type="default" @tap="goAddPeople" hover-class="is-hover">新增人员</button>
</view>
<uni-section class="mb-10" title="历史订单" type="line">
<uni-datetime-picker v-model="range" type="date" @change="onDatePackerChange"/>
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" type="daterange" />
</uni-section>
<view class="item-wrapper">
<u-cell-group>
@ -118,7 +121,13 @@ export default {
}
</script>
<style lang="scss" scoped>
<style lang="scss" scoped>
button {
color: #ffffff;
background: #5fd9ee;
width: 90%;
margin-top: 20rpx;
}
.example-body {
}

Loading…
Cancel
Save