Browse Source

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

master
tianyi@bogon 3 years ago
parent
commit
aa71afdcde
  1. 1062
      pages/index/addHangOrder.vue
  2. 2
      pages/index/orderDetail.vue
  3. 56
      pages/index/returnList.vue
  4. 35
      pages/inventory/addinventory.vue
  5. 1
      pages/inventory/changeGoods1.vue
  6. 68
      pages/inventory/inventory.vue

1062
pages/index/addHangOrder.vue

File diff suppressed because it is too large

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) => {

56
pages/index/returnList.vue

@ -10,20 +10,26 @@
</li> </li>
</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"
v-model="val.returnCount"></u-number-box> v-model="val.returnCount"></u-number-box>
</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>
@ -106,8 +112,44 @@
float: right; float: right;
} }
} }
}
.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;

35
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
} }

68
pages/inventory/inventory.vue

@ -1,4 +1,4 @@
<!-- 库存列表页 --> <!-- 库存列表页 -->
<template> <template>
<view style="display: flex;flex-direction: column;height: 1280rpx;"> <view style="display: flex;flex-direction: column;height: 1280rpx;">
<view class="" style="display: flex;border-top: 1px solid #eee;border-bottom: 1px solid #eee;"> <view class="" style="display: flex;border-top: 1px solid #eee;border-bottom: 1px solid #eee;">
@ -52,16 +52,19 @@
</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>
<text v-else>{{item.purchasePrice}}</text> <text v-else>{{item.purchasePrice}}</text>
<text>采购价</text> <text>采购价</text>
</view> </view>
@ -162,8 +165,8 @@
} }
} }
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