Browse Source

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

master
tianyi@bogon 3 years ago
parent
commit
aa71afdcde
  1. 272
      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. 60
      pages/inventory/inventory.vue

272
pages/index/addHangOrder.vue

@ -9,11 +9,12 @@
<ul> <ul>
<li> <li>
<view class="name"> <view class="name">
<view style="flex:1;">{{item.saleName}}</view> <view class="sale-name">{{item.saleName}}</view>
<view class="btn-list"> <view class="btn-list">
<view class="bj-btn" @tap.stop="inputDialogToggle('edit', item)">编辑</view> <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="toggle('center',item)">语音备注</view>
<view class="bj-btn" @tap.stop="scanCodeAdd(item)">扫码选货</view>
<view class="bj-btn" @tap.stop="goSaleGoods()">开单</view>
</view> </view>
</view> </view>
<view class="name-date"> <view class="name-date">
@ -29,16 +30,20 @@
<text style="color: red;">备注:</text> <text style="color: red;">备注:</text>
{{item.remark}} {{item.remark}}
</view> </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"> <view class="order-name">
{{items.productName}} {{items.productSn}} {{items.productName}} {{items.productSn}}
<img :src="items.purchasePrice" @tap.stop="largeImg" alt=""> <img :src="items.productPicture" @tap.stop="largeImg(items.productPicture)" alt="">
</view> </view>
<view class="specs-name" v-for="itemss in items.saleDetailQueryDTO"> <view class="specs-name" v-for="(itemss,index2) in items.stockLogList1">
{{itemss.attributeList}} * {{itemss.productCount}} <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>
<view class="del-icon" @tap.stop="delGoodsPrecs"><uni-icons color="red" type="trash"
size="26"></uni-icons></view>
</view> </view>
</view> </view>
</view> </view>
@ -82,7 +87,8 @@
<view class="shop-popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}} <view class="shop-popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
</view> </view>
<view class="shop-popup-title-right-box">{{goodsDetail.productSn}}</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> <text style="margin-right:20rpx;">修改价格</text>
</view> </view>
</view> </view>
@ -152,7 +158,7 @@
<!-- 查看大图弹出层 --> <!-- 查看大图弹出层 -->
<uni-popup ref="imgPopup" background-color="#fff" @change="change"> <uni-popup ref="imgPopup" background-color="#fff" @change="change">
<view class="img-popup-content"> <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> </view>
</uni-popup> </uni-popup>
</view> </view>
@ -167,9 +173,9 @@
voiceText: '', voiceText: '',
recordState: false, recordState: false,
pageNumber: 1, pageNumber: 1,
regList:[], regList: [],
list:[], list: [],
value:'', value: '',
indexList: [], indexList: [],
pageNum: 1, //分页的页码 pageNum: 1, //分页的页码
shopList: [], shopList: [],
@ -189,10 +195,23 @@
evalue: [], evalue: [],
attributeList: [], attributeList: [],
purchasePrice: 0, purchasePrice: 0,
zPrice:0, zPrice: 0,
zNum:0, zNum: 0,
storageType: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() { onLoad() {
@ -210,7 +229,7 @@
} }
this.tui.request("/app/sale/listPages", "POST", obj, false, false).then((res) => { this.tui.request("/app/sale/listPages", "POST", obj, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
for (let i=0;i<res.result.records.length;i++) { for (let i = 0; i < res.result.records.length; i++) {
res.result.records[i].isCollapse = false res.result.records[i].isCollapse = false
} }
this.regList = res.result.records; this.regList = res.result.records;
@ -273,7 +292,7 @@
// 识别错误事件 // 识别错误事件
manager.onError = (res) => { manager.onError = (res) => {
if(res.retcode == '-40001'){ if (res.retcode == '-40001') {
uni.showToast({ uni.showToast({
title: '使用次数超限制,请联系管理员!', title: '使用次数超限制,请联系管理员!',
icon: 'none' icon: 'none'
@ -282,10 +301,15 @@
} }
}, },
//扫一扫功能 //扫一扫功能
scanCodeAdd(id) { scanCodeAdd(item) {
uni.scanCode({ uni.scanCode({
success: (res) => { 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); this.toggle('bottom', res.result);
}, },
@ -305,13 +329,12 @@
this.goodsDetail.attributeList[index].value[index1].isChecked = true; this.goodsDetail.attributeList[index].value[index1].isChecked = true;
var name = '', var name = '',
evalue = [], evalue = [],
obj = {}, obj = {}
specsList = []
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) { for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) { for (var m = 0, Ien = this.goodsDetail.attributeList[i].value; m < Ien.length; m++) {
if (Ien[m].isChecked == true) { if (Ien[m].isChecked == true) {
evalue.push(Ien[m].value) evalue.push(Ien[m].value)
name += Ien[m].value name += Ien[m].value + '/'
} }
} }
} }
@ -325,12 +348,18 @@
} }
} }
if (this.goodsDetail.attributeList.length == jishuqi) { if (this.goodsDetail.attributeList.length == jishuqi) {
let data = {}
this.attributeList = { this.attributeList = {
attributeList: JSON.stringify(obj), attributeList: JSON.stringify(obj),
productCount: this.temporaryNum, productCount: this.temporaryNum,
name:name, name: name,
price:this.purchasePrice 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) { if (this.temporaryList.length == 0) {
this.temporaryList.push(this.attributeList); this.temporaryList.push(this.attributeList);
@ -340,7 +369,7 @@
this.temporaryList[i] = this.attributeList this.temporaryList[i] = this.attributeList
return return
} else { } else {
if (this.temporaryList.length == (i+1)) { if (this.temporaryList.length == (i + 1)) {
this.temporaryList.push(this.attributeList); this.temporaryList.push(this.attributeList);
return return
} }
@ -348,48 +377,45 @@
} }
} }
} }
}, },
temporaryChange(val) { temporaryChange(val) {
this.zNum = 0 this.zNum = 0
for (var i=0;i<this.temporaryList.length;i++) { for (var i = 0; i < this.temporaryList.length; i++) {
this.zNum += this.temporaryList[i].productCount this.zNum += this.temporaryList[i].productCount
} }
this.zPrice = this.zNum * this.purchasePrice this.zPrice = this.zNum * this.purchasePrice
}, },
//弹窗选择规格后,点击弹窗中选好了按钮 //弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() { temporaryCheck() {
if(this.storageType == 0 && this.purchasePrice == 0){ if (this.storageType == 0 && this.purchasePrice == 0) {
uni.showToast({ uni.showToast({
title: "请输入实际价格!", title: "请输入实际价格!",
icon: 'none' icon: 'none'
}) })
}else{ } else {
let data = { let data = {
discount: 10, discount: 10,
productId: this.goodsDetail.id, productId: this.goodsDetail.id,
realPrice: this.zPrice, realPrice: this.zPrice,
productCount: this.zNum, productCount: this.zNum,
discountAmount:this.zPrice, discountAmount: this.zPrice,
productName: this.goodsDetail.productName, productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn, productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture, productPicture: this.goodsDetail.productPicture,
supplierName: this.goodsDetail.supplierName, supplierName: this.goodsDetail.supplierName,
saleDetailQueryDTO:this.temporaryList stockLogList1: this.temporaryList
} }
// if(){
// }
this.carList.push(data) this.carList.push(data)
console.log(this.carList); // this.temporaryList = []
this.temporaryList = [] this.purchasePrice = ''
this.purchasePrice = ''
this.zPrice = '' this.zPrice = ''
this.zNum = '' this.zNum = ''
for(let i=0;i<this.goodsDetail.attributeList.length;i++){ for (let i = 0; i < this.goodsDetail.attributeList.length; i++) {
this.goodsDetail.attributeList[i].isChecked = false; this.goodsDetail.attributeList[i].isChecked = false;
for (let m=0;m<this.goodsDetail.attributeList[i].value.length;m++) { for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) {
this.goodsDetail.attributeList[i].value[m].isChecked = false this.goodsDetail.attributeList[i].value[m].isChecked = false
} }
} }
@ -399,11 +425,11 @@
} }
}, },
//保存扫码选择的商品 //保存扫码选择的商品、删除整条商品数据都用这个方法
setSaleDetail(){ setSaleDetail() {
this.tui.request("/app/sale/setSaleDetail", "post", { this.tui.request("/app/sale/setSaleDetail", "post", {
saleDetailList:this.carList, saleDetailList: this.carList,
saleId:this.hangId saleId: this.hangId
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.getRegList() this.getRegList()
@ -427,21 +453,21 @@
} }
}, },
//新增挂单弹窗 //新增挂单弹窗
inputDialogToggle(type,list) { inputDialogToggle(type, list) {
this.value = '' this.value = ''
if(type=="add"){ if (type == "add") {
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
}else if(type=='edit'){ } else if (type == 'edit') {
this.list = list; this.list = list;
this.value = list.saleName this.value = list.saleName
this.$refs.setDialog.open() this.$refs.setDialog.open()
}else{ } else {
this.$refs.payDialog.open() this.$refs.payDialog.open()
} }
}, },
//通过商品id查询商品详细信息 //通过商品id查询商品详细信息
getById(id) { getById(id) {
this.tui.request("/app/product/getById/"+id, "POST", {}, false, true).then((res) => { this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.goodsDetail = res.result; this.goodsDetail = res.result;
if (typeof(this.goodsDetail.attributeList) == 'string') { if (typeof(this.goodsDetail.attributeList) == 'string') {
@ -477,7 +503,8 @@
}).catch((res) => {}) }).catch((res) => {})
}, },
//查看大图 //查看大图
largeImg() { largeImg(img) {
this.bigImg = img
this.$refs.imgPopup.open() this.$refs.imgPopup.open()
}, },
//新增挂单 //新增挂单
@ -495,33 +522,69 @@
this.tui.toast(res) this.tui.toast(res)
}) })
}, },
//删除商品规格确认弹窗 //删除整条挂单
delGoodsPrecs(id) { delHangOrder() {
let that = this;
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "确定删除此条商品吗?", content: "确定删除此条挂单记录吗?",
success: function(res) { success: function(res) {
this.tui.request("/app/sale/delById", "POST", { that.tui.request("/app/sale/delById", "POST", {
id: id id: id
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.tui.toast("删除成功") that.tui.toast("删除成功")
this.getRegList(); that.getRegList();
} else { } else {
this.tui.toast(res.message) that.tui.toast(res.message)
} }
}).catch((res) => { }).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(){ setDetail() {
this.tui.request("/app/sale/updateOrder", "POST", { this.tui.request("/app/sale/updateOrder", "POST", {
saleName:this.value, saleName: this.value,
id:this.list.id, id: this.list.id,
remark:this.voiceText remark: this.voiceText
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.tui.toast("编辑成功") this.tui.toast("编辑成功")
@ -534,9 +597,15 @@
}) })
}, },
//选择是零售价还是批发价 //选择是零售价还是批发价
checkPay(price){ checkPay(price) {
this.purchasePrice = price; this.purchasePrice = price;
this.$refs.payDialog.close() this.$refs.payDialog.close()
},
//带参数跳转到开单页
goSaleGoods() {
uni.navigateTo({
url: '/pages/inventory/goodsList1'
})
} }
} }
} }
@ -545,7 +614,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
button { button {
color: #ffffff; color: #ffffff;
background: #5fd9ee; background: linear-gradient(90deg, #60F3FF, #088FEB);
width: 90%; width: 90%;
margin-top: 20upx; margin-top: 20upx;
} }
@ -574,8 +643,8 @@
.name { .name {
width: 100%; width: 100%;
display: flex; display: flex;
float: left; float: left;
} }
.del-icon { .del-icon {
@ -630,7 +699,10 @@
} }
.specs-name { .specs-name {
display: flex;
padding-bottom: 20rpx; padding-bottom: 20rpx;
height: 60rpx;
line-height: 60rpx;
} }
.order-name { .order-name {
@ -638,6 +710,7 @@
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
line-height: 80rpx; line-height: 80rpx;
img { img {
height: 32rpx; height: 32rpx;
width: 32rpx; width: 32rpx;
@ -722,59 +795,79 @@
margin: 0 auto; margin: 0 auto;
} }
.sale-name {
width: 300rpx;
height: 80rpx;
padding: 0 20rpx;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.btn-list { .btn-list {
flex: 1; // flex: 1;
} }
.shop-popup-content{
.shop-popup-content {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 15px; padding: 15px;
height: 1200rpx; height: 1200rpx;
background-color: #fff; background-color: #fff;
} }
.shop-popup-title{
.shop-popup-title {
display: flex; display: flex;
height: 180rpx; height: 180rpx;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
margin-top: 20rpx; margin-top: 20rpx;
} }
.shop-popup-title-left{
.shop-popup-title-left {
width: 150rpx; width: 150rpx;
height: 150rpx; height: 150rpx;
} }
.shop-popup-title-right{
.shop-popup-title-right {
width: 400rpx; width: 400rpx;
margin-left: 30rpx; margin-left: 30rpx;
} }
.shop-popup-title-right-box{
.shop-popup-title-right-box {
height: 50rpx; height: 50rpx;
line-height: 50rpx; line-height: 50rpx;
} }
.shop-checkList{
.shop-checkList {
display: flex; display: flex;
height: 50rpx; height: 50rpx;
font-size: 28rpx; font-size: 28rpx;
line-height: 50rpx; line-height: 50rpx;
margin: 20rpx 0; margin: 20rpx 0;
} }
.shop-checkList-box{
.shop-checkList-box {
height: 50rpx; height: 50rpx;
width: 60%; width: 60%;
} }
.shop-popup-bottom{
.shop-popup-bottom {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
display: flex; display: flex;
} }
.shop-popup-bottom-left{
.shop-popup-bottom-left {
width: 50%; width: 50%;
line-height: 80rpx; line-height: 80rpx;
} }
.shop-popup-bottom-right{
.shop-popup-bottom-right {
width: 50%; width: 50%;
line-height: 100rpx; line-height: 100rpx;
.bottom-btn { .bottom-btn {
width: 70%; width: 70%;
line-height: 35px; line-height: 35px;
@ -787,31 +880,36 @@
border-radius: 70rpx; border-radius: 70rpx;
} }
} }
.shop-popup-container{
.shop-popup-container {
width: 100%; width: 100%;
background: #fff; background: #fff;
height: 50rpx; height: 50rpx;
} }
.shop-purchase-price{
.shop-purchase-price {
display: flex; display: flex;
line-height: 40px; line-height: 40px;
height: 80rpx; height: 80rpx;
width: 95%; width: 95%;
margin: 20rpx auto; margin: 20rpx auto;
} }
.shop-title-fur{
.shop-title-fur {
width: 95%; width: 95%;
height: 70rpx; height: 70rpx;
margin: 0 auto; margin: 0 auto;
} }
.shop-name{
.shop-name {
font-size: 30rpx; font-size: 30rpx;
width: 50%; width: 50%;
float: left; float: left;
height: 70rpx; height: 70rpx;
line-height: 70rpx; line-height: 70rpx;
} }
.shop-attrs{
.shop-attrs {
text { text {
display: inline-block; display: inline-block;
border: 1px solid #5fd9ee; border: 1px solid #5fd9ee;
@ -829,12 +927,14 @@
color: #fff; color: #fff;
} }
} }
.shop-popup-title-left img { .shop-popup-title-left img {
width: 150rpx; width: 150rpx;
height: 150rpx; height: 150rpx;
} }
.popup-pay-content{
.popup-pay-content {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 15px; padding: 15px;
@ -842,12 +942,14 @@
height: auto; height: auto;
background-color: #fff; background-color: #fff;
} }
.popup-pay-title { .popup-pay-title {
font-size: 36rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
position: relative; position: relative;
} }
.popup-pay-container { .popup-pay-container {
margin-top: 20rpx; margin-top: 20rpx;
height: 100rpx; height: 100rpx;

2
pages/index/orderDetail.vue

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

50
pages/index/returnList.vue

@ -11,11 +11,14 @@
</ul> </ul>
<uni-popup ref="popup" background-color="#fff"> <uni-popup ref="popup" background-color="#fff">
<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }"> <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 :value="[shopList[0].saleId]">
<u-collapse-item v-for="(item,index) in shopList" :key="index" :title="item.productName" :name="item.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"> <view class="u-collapse-content" v-for="(val, index2) in item.stockLogList1" :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> -->
{{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }} {{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }}
* {{val.productCount}} * {{val.productCount}}
<u-number-box integer v-if="isReturn" :max="val.productCount" :min="0" <u-number-box integer v-if="isReturn" :max="val.productCount" :min="0"
@ -23,7 +26,10 @@
</view> </view>
</u-collapse-item> </u-collapse-item>
</u-collapse> </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> </view>
</uni-popup> </uni-popup>
</view> </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 { .popup-content {
padding: 40rpx; padding: 40rpx;
width: 80vw; width: 80vw;

33
pages/inventory/addinventory.vue

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

1
pages/inventory/changeGoods1.vue

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

60
pages/inventory/inventory.vue

@ -52,13 +52,16 @@
</view> </view>
</view> </view>
<view class="content-right"> <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"> <view class="box-left">
<img :src="item.productPicture" alt=""> <img :src="item.productPicture" alt="">
</view> </view>
<view class="box-right"> <view class="box-right">
<view class="box-right-name">{{item.productName}}</view> <view class="box-right-name">{{item.productName}}</view>
<view class="box-right-num">{{item.productSn}}</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="box-right-price">
<view class="price-box"> <view class="price-box">
<text v-if="item.purchasePrice==null" style="color: red;">未入库</text> <text v-if="item.purchasePrice==null" style="color: red;">未入库</text>
@ -162,7 +165,7 @@
} }
} }
this.getShareList(this.indexList[0].id); this.getShareList(this.indexList[0].id);
} else{ } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }
}).catch((res) => {}) }).catch((res) => {})
@ -178,22 +181,59 @@
} }
this.getShareList(this.indexList[index].id) this.getShareList(this.indexList[index].id)
}, },
//入库单详情
goDetail(id) {
uni.navigateTo({
url: '/pages/inventory/inventoryDetail?id=' + id
})
},
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", { this.tui.request("/app/product/getShareList", "POST", {
categoryId:id, categoryId: id,
supplierName:this.keyword, supplierName: this.keyword,
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: '10' pageSize: '10'
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log(res.result.records) console.log(res.result.records)
this.shopList = res.result.records this.shopList = res.result.records
} else{ } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }
}).catch((res) => {}) }).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) { onGridClick(target) {
if (target == '0') { if (target == '0') {
@ -387,4 +427,14 @@
.uni-searchbar__box { .uni-searchbar__box {
width: 100% !important; width: 100% !important;
} }
.up-down {
position: absolute;
top: 20rpx;
right: 10rpx;
color: #fff;
background: #088FEB;
padding: 10rpx 10rpx;
border-radius: 10px;
}
</style> </style>
Loading…
Cancel
Save