Browse Source

开单,入库,挂单页面缝缝补补

master
tianyi@bogon 3 years ago
parent
commit
aa71afdcde
  1. 172
      pages/index/addHangOrder.vue
  2. 2
      pages/index/orderDetail.vue
  3. 50
      pages/index/returnList.vue
  4. 33
      pages/inventory/addinventory.vue
  5. 1
      pages/inventory/changeGoods1.vue
  6. 52
      pages/inventory/inventory.vue

172
pages/index/addHangOrder.vue

@ -9,11 +9,12 @@
<ul>
<li>
<view class="name">
<view style="flex:1;">{{item.saleName}}</view>
<view class="sale-name">{{item.saleName}}</view>
<view class="btn-list">
<view class="bj-btn" @tap.stop="inputDialogToggle('edit', item)">编辑</view>
<view class="bj-btn" @tap.stop="scanCodeAdd(item.id)">扫码开单</view>
<view class="bj-btn" @tap.stop="toggle('center',item)">语音备注</view>
<view class="bj-btn" @tap.stop="scanCodeAdd(item)">扫码选货</view>
<view class="bj-btn" @tap.stop="goSaleGoods()">开单</view>
</view>
</view>
<view class="name-date">
@ -29,16 +30,20 @@
<text style="color: red;">备注:</text>
{{item.remark}}
</view>
<view class="shop-list" v-for="items in item.saleDetailDTOList">
<view class="shop-list" v-for="(items,index1) in item.saleDetailDTOList">
<view class="order-name">
{{items.productName}} {{items.productSn}}
<img :src="items.purchasePrice" @tap.stop="largeImg" alt="">
<img :src="items.productPicture" @tap.stop="largeImg(items.productPicture)" alt="">
</view>
<view class="specs-name" v-for="itemss in items.saleDetailQueryDTO">
{{itemss.attributeList}} * {{itemss.productCount}}
<view class="specs-name" v-for="(itemss,index2) in items.stockLogList1">
<view style="margin-right:5%;" @tap="delGoodsPrecs(item,index1,index2)">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
{{itemss.attributeList | sliceMsg}} * {{itemss.productCount}}
</view>
<view class="del-icon" @tap.stop="delGoods(item,items.productId)">
<uni-icons color="red" type="trash" size="26"></uni-icons>
</view>
<view class="del-icon" @tap.stop="delGoodsPrecs"><uni-icons color="red" type="trash"
size="26"></uni-icons></view>
</view>
</view>
</view>
@ -82,7 +87,8 @@
<view class="shop-popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
</view>
<view class="shop-popup-title-right-box">{{goodsDetail.productSn}}</view>
<view class="popup-title-right-box" style="color: darkorange;" @tap="inputDialogToggle('payDialog')">
<view class="popup-title-right-box" style="color: darkorange;"
@tap="inputDialogToggle('payDialog')">
<text style="margin-right:20rpx;">修改价格</text>
</view>
</view>
@ -152,7 +158,7 @@
<!-- 查看大图弹出层 -->
<uni-popup ref="imgPopup" background-color="#fff" @change="change">
<view class="img-popup-content">
<img src="/static/images/logo.png" alt="" style="width: 100%;height: 100%;">
<img :src="bigImg" alt="" style="width: 100%;height: 100%;">
</view>
</uni-popup>
</view>
@ -192,7 +198,20 @@
zPrice: 0,
zNum: 0,
storageType: 0,
hangId:''
hangId: '',
bigImg: ''
}
},
filters: {
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
}
},
onLoad() {
@ -282,10 +301,15 @@
}
},
//扫一扫功能
scanCodeAdd(id) {
scanCodeAdd(item) {
uni.scanCode({
success: (res) => {
this.hangId = id
this.hangId = item.id
if (item.saleDetailDTOList) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
this.carList.push(item.saleDetailDTOList[i])
}
}
this.toggle('bottom', res.result);
},
@ -305,13 +329,12 @@
this.goodsDetail.attributeList[index].value[index1].isChecked = true;
var name = '',
evalue = [],
obj = {},
specsList = []
obj = {}
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) {
if (Ien[m].isChecked == true) {
evalue.push(Ien[m].value)
name += Ien[m].value
name += Ien[m].value + '/'
}
}
}
@ -325,13 +348,19 @@
}
}
if (this.goodsDetail.attributeList.length == jishuqi) {
let data = {}
this.attributeList = {
attributeList: JSON.stringify(obj),
productCount: this.temporaryNum,
name: name,
price: this.purchasePrice
}
for (let i = 0; i < this.goodsDetail.attributeList.length; i++) {
this.goodsDetail.attributeList[i].isChecked = false;
for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) {
this.goodsDetail.attributeList[i].value[m].isChecked = false
}
}
if (this.temporaryList.length == 0) {
this.temporaryList.push(this.attributeList);
} else {
@ -348,6 +377,7 @@
}
}
}
},
@ -376,14 +406,10 @@
productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture,
supplierName: this.goodsDetail.supplierName,
saleDetailQueryDTO:this.temporaryList
stockLogList1: this.temporaryList
}
// if(){
// }
this.carList.push(data)
console.log(this.carList);
this.temporaryList = []
// this.temporaryList = []
this.purchasePrice = ''
this.zPrice = ''
this.zNum = ''
@ -399,7 +425,7 @@
}
},
//保存扫码选择的商品
//保存扫码选择的商品、删除整条商品数据都用这个方法
setSaleDetail() {
this.tui.request("/app/sale/setSaleDetail", "post", {
saleDetailList: this.carList,
@ -477,7 +503,8 @@
}).catch((res) => {})
},
//查看大图
largeImg() {
largeImg(img) {
this.bigImg = img
this.$refs.imgPopup.open()
},
//新增挂单
@ -495,27 +522,63 @@
this.tui.toast(res)
})
},
//删除商品规格确认弹窗
delGoodsPrecs(id) {
//删除整条挂单
delHangOrder() {
let that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
content: "确定删除此条挂单记录吗?",
success: function(res) {
this.tui.request("/app/sale/delById", "POST", {
that.tui.request("/app/sale/delById", "POST", {
id: id
}, false, false).then((res) => {
if (res.code == 200) {
this.tui.toast("删除成功")
this.getRegList();
that.tui.toast("删除成功")
that.getRegList();
} else {
this.tui.toast(res.message)
that.tui.toast(res.message)
}
}).catch((res) => {
this.tui.toast(res)
that.tui.toast(res)
})
}
})
},
//删除整条商品
delGoods(item, productId) {
let that = this;
this.hangId = item.id;
console.log(item.saleDetailDTOList)
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
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();
}
})
},
//删除商品下的单条规格
delGoodsPrecs(item, index, index1) {
let that = this;
this.hangId = item.id;
console.log(item.saleDetailDTOList)
uni.showModal({
title: "提示",
content: "确定删除此条规格吗?",
success: function(res) {
item.saleDetailDTOList[index].stockLogList1.splice(item.saleDetailDTOList[index]
.stockLogList1[index1], 1)
that.carList = item.saleDetailDTOList
that.setSaleDetail();
}
})
},
//编辑挂单信息
setDetail() {
this.tui.request("/app/sale/updateOrder", "POST", {
@ -537,6 +600,12 @@
checkPay(price) {
this.purchasePrice = price;
this.$refs.payDialog.close()
},
//带参数跳转到开单页
goSaleGoods() {
uni.navigateTo({
url: '/pages/inventory/goodsList1'
})
}
}
}
@ -545,7 +614,7 @@
<style lang="scss" scoped>
button {
color: #ffffff;
background: #5fd9ee;
background: linear-gradient(90deg, #60F3FF, #088FEB);
width: 90%;
margin-top: 20upx;
}
@ -630,7 +699,10 @@
}
.specs-name {
display: flex;
padding-bottom: 20rpx;
height: 60rpx;
line-height: 60rpx;
}
.order-name {
@ -638,6 +710,7 @@
font-size: 32rpx;
font-weight: bold;
line-height: 80rpx;
img {
height: 32rpx;
width: 32rpx;
@ -722,9 +795,19 @@
margin: 0 auto;
}
.sale-name {
width: 300rpx;
height: 80rpx;
padding: 0 20rpx;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.btn-list {
flex: 1;
// flex: 1;
}
.shop-popup-content {
align-items: center;
justify-content: center;
@ -732,24 +815,29 @@
height: 1200rpx;
background-color: #fff;
}
.shop-popup-title {
display: flex;
height: 180rpx;
border-bottom: 1px solid #eee;
margin-top: 20rpx;
}
.shop-popup-title-left {
width: 150rpx;
height: 150rpx;
}
.shop-popup-title-right {
width: 400rpx;
margin-left: 30rpx;
}
.shop-popup-title-right-box {
height: 50rpx;
line-height: 50rpx;
}
.shop-checkList {
display: flex;
height: 50rpx;
@ -757,10 +845,12 @@
line-height: 50rpx;
margin: 20rpx 0;
}
.shop-checkList-box {
height: 50rpx;
width: 60%;
}
.shop-popup-bottom {
width: 100%;
height: 100rpx;
@ -768,13 +858,16 @@
bottom: 0;
display: flex;
}
.shop-popup-bottom-left {
width: 50%;
line-height: 80rpx;
}
.shop-popup-bottom-right {
width: 50%;
line-height: 100rpx;
.bottom-btn {
width: 70%;
line-height: 35px;
@ -787,11 +880,13 @@
border-radius: 70rpx;
}
}
.shop-popup-container {
width: 100%;
background: #fff;
height: 50rpx;
}
.shop-purchase-price {
display: flex;
line-height: 40px;
@ -799,11 +894,13 @@
width: 95%;
margin: 20rpx auto;
}
.shop-title-fur {
width: 95%;
height: 70rpx;
margin: 0 auto;
}
.shop-name {
font-size: 30rpx;
width: 50%;
@ -811,6 +908,7 @@
height: 70rpx;
line-height: 70rpx;
}
.shop-attrs {
text {
display: inline-block;
@ -829,11 +927,13 @@
color: #fff;
}
}
.shop-popup-title-left img {
width: 150rpx;
height: 150rpx;
}
.popup-pay-content {
align-items: center;
justify-content: center;
@ -842,12 +942,14 @@
height: auto;
background-color: #fff;
}
.popup-pay-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-pay-container {
margin-top: 20rpx;
height: 100rpx;

2
pages/index/orderDetail.vue

@ -370,7 +370,7 @@
},
getReturnOrder(id) {
this.tui.request("/app/return/list", "post", {
shopId: 1,
shopId: "1718514268414021633",
remark: 3,
saleId: id
}, false, false).then((res) => {

50
pages/index/returnList.vue

@ -11,11 +11,14 @@
</ul>
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
<view class="popup-content-title">
<view class="title-box">客户名称:张三</view>
<view class="title-box two">创建时间:2023-10-22</view>
<view class="title-box two">退款金额:200 数量:20件</view>
</view>
<u-collapse :value="[shopList[0].saleId]">
<u-collapse-item v-for="(item,index) in shopList" :key="index" :title="item.productName" :name="item.saleId">
<view class="u-collapse-content" v-for="(val, index2) in item.saleDetailQueryDTO" :key="index2">
<!-- <u-icon name="checkmark-circle" color="#5fd9ee" size="20" v-if="isReturn"></u-icon>
<u-icon name="checkmark-circle" color="#999" size="20" v-if="isReturn"></u-icon> -->
<view class="u-collapse-content" v-for="(val, index2) in item.stockLogList1" :key="index2">
{{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }}
* {{val.productCount}}
<u-number-box integer v-if="isReturn" :max="val.productCount" :min="0"
@ -23,7 +26,10 @@
</view>
</u-collapse-item>
</u-collapse>
<u-button type="error" :plain="true" shape="circle" @click="returnGoods" >确认收货</u-button>
<view class="popup-content-bottom">
<view class="bottom-btn">拒绝</view>
<view class="bottom-btn" @tap="returnGoods">确认收货</view>
</view>
</view>
</uni-popup>
</view>
@ -107,7 +113,43 @@
}
}
}
.popup-content-title{
padding: 0 30rpx;
}
.title-box{
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
font-weight: bold;
}
.two{
font-size: 28rpx;
color:#777;
font-weight: normal;
}
.popup-content-bottom{
display:flex;
margin-top:20rpx;
}
.bottom-btn{
flex: 1;
text-align: center;
line-height: 40px;
height: 80rpx;
font-size: 32rpx;
background: #5fd9ee;
color: #fff;
}
.bottom-btn:first-child{
border-top-left-radius: 80rpx;
border-bottom-left-radius: 80rpx;
}
.bottom-btn:last-child{
border-left: 1px solid #eee;
border-top-right-radius: 80rpx;
border-bottom-right-radius: 80rpx;
}
.popup-content {
padding: 40rpx;
width: 80vw;

33
pages/inventory/addinventory.vue

@ -147,9 +147,7 @@
onShow() {
let that = this;
this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
//this.carList1 //上个页回来的
//this.carList //这个页的最终数组
console.log(this.carList1)
this.totalAmount = 0;
if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < this.carList1.length; i++) {
let obj = {
@ -167,9 +165,7 @@
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
.saleDetailQueryDTO[m].productCount)
}
console.log("没有数据")
this.carList.set(this.carList1[i].id, obj)
console.log(this.carList)
}
this.carList1 = []
} else { //当前页有数据
@ -178,13 +174,11 @@
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) { //规格相同
console.log("规格相同")
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)
} else { //规格不同
console.log("规格不同")
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount)
}
@ -208,13 +202,9 @@
}
this.carList.set(this.carList1[i].id, obj)
}
}
this.carList1 = []
}
console.log('carList1', this.carList1)
console.log('carList', this.carList)
this.carList.forEach(function(value, key) {
that.totalAmount += value.productCount
})
@ -256,8 +246,6 @@
})
},
inventorySubmit() {
console.log(this.khName)
console.log(Array.from(this.carList)[1])
if (this.khName == '' || this.carList == '') {
uni.showToast({
title: "信息填写完成后入库!",
@ -274,22 +262,8 @@
supplierId: this.khName.id, //供应商id和姓名
supplierName: this.khName.consigneeName
}
// that.carList.forEach(function(value, key) {
// for (let i = 0; i < value.saleDetailQueryDTO.length; i++) {
// let obj = {
// purchasePrice: value.price, //进货价
// productCount: value.num,
// productId: key,
// productName: value.productName,
// productPicture: value.productPicture,
// stockLogList: value.saleDetailQueryDTO
// }
// purchaseDetails.push(obj)
// }
let purchaseDetails = [];
this.carList.forEach(function(value, key) {
console.log(value.stockLogList)
value.stockLogList.forEach(function(values, keys) {
let obj = {
productCount: values,
@ -297,11 +271,8 @@
}
value.stockLogList1.push(obj)
})
console.log(value)
purchaseDetails.push(value)
})
console.log(purchaseDetails)
this.tui.request("/app/stock/putInOfProduct", "post", {
purchase: purchase,
purchaseDetails: purchaseDetails
@ -324,8 +295,8 @@
},
//编辑每一个的单价
clickCollapse(index) {
console.log(index)
this.index = index
this.$refs.inputDialog.val = ''
this.$refs.inputDialog.open()
},
//计算价格

1
pages/inventory/changeGoods1.vue

@ -313,6 +313,7 @@
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if (type == 'carPopup') {
this.$refs.carPopup.open('bottom')
this.carNum = 0
for (let i=0;i<this.carList.length;i++) {
this.carNum += this.carList[i].num
}

52
pages/inventory/inventory.vue

@ -52,13 +52,16 @@
</view>
</view>
<view class="content-right">
<view class="right-box" v-for="item in shopList" :key="item">
<view class="right-box" v-for="item in shopList" :key="item" @tap="goDetail(item.id)">
<view class="box-left">
<img :src="item.productPicture" alt="">
</view>
<view class="box-right">
<view class="box-right-name">{{item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</view>
<!-- 1上架 0下架 -->
<view class="up-down" v-if="item.delFlag ==1" @tap.stop="upDown('0',item)">去下架</view>
<view class="up-down" v-if="item.delFlag ==0" @tap.stop="upDown('1',item)">去上架</view>
<view class="box-right-price">
<view class="price-box">
<text v-if="item.purchasePrice==null" style="color: red;">未入库</text>
@ -178,6 +181,12 @@
}
this.getShareList(this.indexList[index].id)
},
//入库单详情
goDetail(id) {
uni.navigateTo({
url: '/pages/inventory/inventoryDetail?id=' + id
})
},
//点击分类获取商品列表
getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", {
@ -194,6 +203,37 @@
}
}).catch((res) => {})
},
//商品上下架
upDown(type, data) {
uni.showModal({
title: "提示",
content: "确定将此款商品" + type == 0 ? "下架" : "上架" + "吗?",
success: function(res) {
if (type == 0) { //下架
this.tui.request("/app/product/down", "POST", {
id: data.id
}, false, false).then((res) => {
if (res.code == 200) {
this.tui.toast("下架成功")
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
} else { //上架
this.tui.request("/app/product/up", "POST", {
id: id
}, false, false).then((res) => {
if (res.code == 200) {
this.tui.toast("上架成功")
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}
this.getShareList(data.categoryId)
}
})
},
//点击头部 分类管理 和 新增入库 按钮
onGridClick(target) {
if (target == '0') {
@ -387,4 +427,14 @@
.uni-searchbar__box {
width: 100% !important;
}
.up-down {
position: absolute;
top: 20rpx;
right: 10rpx;
color: #fff;
background: #088FEB;
padding: 10rpx 10rpx;
border-radius: 10px;
}
</style>
Loading…
Cancel
Save