wangfukang 3 years ago
parent
commit
0d568b48c7
  1. 157
      pages/billing/changeGoods1.vue
  2. 6
      pages/index/addHangOrder.vue
  3. 4
      pages/index/downStearmList.vue
  4. 6
      pages/index/order.vue
  5. 137
      pages/inventory/changeGoods1.vue
  6. 22
      pages/inventory/goodsList1.vue
  7. 11
      pages/other/logistics.vue

157
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>
@ -204,7 +204,28 @@
storageType: '',
carNum: 0,
carType: 0,
type:'',
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() {
@ -337,6 +358,10 @@
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
}
@ -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) => {
@ -396,9 +488,9 @@
this.getShareList()
},
//未入库遮罩
clickMask(item){
clickMask(item) {
let title = ''
if(item.delFlag == 0){
if (item.delFlag == 0) {
title = '请将商品上架后再操作!'
}
// else if(item.delFlag == 1){
@ -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)
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)
}
}
})
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) {

6
pages/index/addHangOrder.vue

@ -540,6 +540,7 @@
title: "提示",
content: "确定删除此条挂单记录吗?",
success: function(res) {
if (res.confirm) {
that.tui.request("/app/sale/delById", "POST", {
id: id
}, false, false).then((res) => {
@ -553,6 +554,7 @@
that.tui.toast(res)
})
}
}
})
},
//删除整条商品
@ -564,6 +566,7 @@
title: "提示",
content: "确定删除此条商品吗?",
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)
@ -572,6 +575,7 @@
that.carList = item.saleDetailDTOList
that.setSaleDetail();
}
}
})
},
//删除商品下的单条规格
@ -583,11 +587,13 @@
title: "提示",
content: "确定删除此条规格吗?",
success: function(res) {
if (res.confirm) {
item.saleDetailDTOList[index].stockLogList1.splice(item.saleDetailDTOList[index]
.stockLogList1[index1], 1)
that.carList = item.saleDetailDTOList
that.setSaleDetail();
}
}
})
},
//编辑挂单信息

4
pages/index/downStearmList.vue

@ -431,8 +431,10 @@
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
that.carList.splice(i, 1)
}
}
})
}
}
@ -448,11 +450,13 @@
title: "提示",
content: "确定删除此条商品吗?",
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)
}
}
}
})
}
}

6
pages/index/order.vue

@ -1,8 +1,9 @@
<template>
<view>
<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 {

137
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,7 +184,28 @@
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() {
@ -315,18 +336,88 @@
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.$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) {
this.tui.request("/app/product/getById/" + item.id, "POST", {}, false, true).then((res) => {
@ -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)
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)
}
}
})
if (res.confirm) {
that.newList.get(id).stockLogList.delete(name)
if (that.newList.get(id).stockLogList.size == 0) {
that.newList.delete(id)
}
}
that.$forceUpdate()
}
})
}
}
}

22
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: '拼包'
@ -402,6 +398,10 @@
value: '4',
name: '发车'
},
{
value: '2',
name: '自提'
},
],
discountType: '', //折扣类型
discountCurrent: '',
@ -461,8 +461,10 @@
}
this.totalAmount = 0;
this.shouldPay = 0
if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < this.carList1.length; i++) {
if (this.carList.size == 0) { //当前页没有数据
let obj = {
purchasePrice: this.carList1[i].price, //采购价
price: 0, //总价
@ -486,12 +488,12 @@
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[
@ -535,11 +537,11 @@
this.carList.set(this.carList1[i].id, obj)
}
}
uni.removeStorageSync('carList1')
this.carList1 = []
}
}
this.carList.forEach(function(value, key) {
if (that.priceType == 0) { //零售
value.unitPrice = value.lsprice
@ -1258,6 +1260,7 @@
title: "提示",
content: "确定清空全部已选商品吗?",
success: function(res) {
if (res.confirm) {
that.carList.clear()
that.remark = ''
that.temporaryList = []
@ -1278,6 +1281,7 @@
that.xsyId = ''
this.saleId = ''
}
}
})
}
}

11
pages/other/logistics.vue

@ -1,7 +1,10 @@
<template>
<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>
@ -119,6 +122,12 @@ export default {
</script>
<style lang="scss" scoped>
button {
color: #ffffff;
background: #5fd9ee;
width: 90%;
margin-top: 20rpx;
}
.example-body {
}

Loading…
Cancel
Save