wangfukang 3 years ago
parent
commit
8e342360d2
  1. 263
      pages/inventory/getProductIdToList.vue
  2. 35
      pages/inventory/inventoryDetail.vue
  3. 1
      pages/other/custom.vue

263
pages/inventory/getProductIdToList.vue

@ -0,0 +1,263 @@
<template>
<view class="container">
<view class="tui-order-item boxbg">
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(item,index) in list" :key="index">
<view>时间:{{item.createTime}}</view>
<view>数量:{{item.productCount}} 总价:{{item.realAmount}}</view>
<view v-for="(items,index1) in item.saleDetailDTOList">
<view>
单价:{{items.discountAmount}} * {{items.productCount}}
</view>
</view>
</view>
<u-loadmore :status="status" />
</view>
</view>
</template>
<script>
export default {
data() {
return {
list:[],
status: 'loadmore',
pages: 1,
pageNum: 1,
productId:''
}
},
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(option) {
this.productId = option.id
this.getWaitStorage()
},
onReachBottom() {
if (this.pages >= this.pageNum) return;
this.status = 'loading';
this.pages = ++this.pages;
this.getWaitStorage();
},
methods: {
getWaitStorage(id) {
this.status = 'loading';
this.tui.request("/app/sale/getSaleListByProductId", "post", {
productId: this.productId,
pageSize: 10,
pageNum: this.pageNum
}, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
// this.list = res.result.records
if (this.pages == 1) {
this.list = res.result.records
} else {
this.list = [...this.list, ...res.result.records]
}
this.pageNum = res.result.pages
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}
},
}
</script>
<style lang="scss" scoped>
.container {
padding-bottom: 118rpx;
.boxbg {
background-color: #fff;
margin: 30upx;
border-radius: 10upx;
box-shadow: 0px 1px 10px 2px #e2e2e2;
}
.tui-order-item {
.u-collapse-content {
display: flex;
justify-content: space-between;
line-height: 30px;
}
.tui-goods-info {
width: 100%;
box-sizing: border-box;
background: #fff;
line-height: 26px;
border-top: 10px solid #eee;
.tui-price-flex {
display: flex;
align-items: center;
justify-content: space-between;
}
.tui-size32 {
font-size: 32rpx;
font-weight: 500;
}
.tui-size-24 {
font-size: 24rpx;
}
.tui-price-large {
font-size: 32rpx;
.lineText {
text-decoration: line-through;
font-size: 12px;
color: #888;
}
}
.tui-flex-shrink {
flex-shrink: 0;
}
.tui-goods-price {
width: 100%;
display: flex;
align-items: flex-end;
justify-content: flex-end;
font-size: 24rpx;
}
.tui-primary-color {
color: #EB0909;
}
.tui-pbtm20 {
padding-bottom: 20rpx;
}
}
}
}
.tui-tabbar {
width: 100%;
height: 98rpx;
background: #fff;
position: fixed;
left: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 26rpx;
box-shadow: 0 0 1px rgba(0, 0, 0, .3);
padding-bottom: env(safe-area-inset-bottom);
z-index: 996;
}
.tui-btn-mr {
width:130rpx;
height: 60rpx;
background: #088FEB;
color: #fff;
border-radius: 10px;
line-height: 60rpx;
text-align: center;
margin-right: 30rpx;
}
.shop-box {
width: 95%;
margin: 0 auto;
position: relative;
}
.shop-name {
width: 100%;
height: 200rpx;
line-height: 80rpx;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
font-size: 28rpx;
font-weight: bold;
display: flex;
.uni-icons {
color: #088FEB !important;
}
}
.shop-productName {
flex: 1;
display: flex;
flex-direction: column;
padding-left: 20rpx;
}
.shop-productName view {
height: 55rpx;
}
.shop-collapse {
display: flex;
height: 80rpx;
font-size: 26rpx;
line-height: 80rpx;
}
.shop-collapse text {
flex: 1;
text-align: center;
padding-right: 40rpx;
border-right: 1px solid #eee;
}
.content-list {
width: 95%;
margin: 0 auto;
display: flex;
height: 80rpx;
border-bottom: 1px solid #eee;
}
.content-list:last-child {
border-bottom: none;
height: auto;
}
.list-name {
width: 200rpx;
text-align: left;
line-height: 40px;
height: 80rpx;
padding-left: 20rpx;
}
.list-val {
width: 560rpx;
height: 80rpx;
line-height: 80rpx;
}
.list-val input {
width: 400rpx;
height: 60rpx;
display: inline-block;
line-height: 60rpx;
float: left;
margin-top: 10rpx;
padding-left: 20rpx;
border-bottom: 1px solid #088FEB;
}
textarea {
margin: 20rpx;
border: 1px solid #eee;
height: 150rpx;
width: 500rpx;
}
</style>

35
pages/inventory/inventoryDetail.vue

@ -49,7 +49,10 @@
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="采购价" placeholder="请输入采购价"
@confirm="changePrice"></uni-popup-dialog>
</uni-popup>
</uni-popup>
<!-- 右下角悬浮按钮 -->
<uni-fab ref="fab" :content="content" :horizontal="horizontal"
@trigger="trigger" />
</view>
</template>
@ -63,8 +66,20 @@
pageNum: 1, //分页的页码
dataList: [],
bufferData: '',
horizontal: 'right',
pecsList:[],
type:''
type:'',
content: [{
iconPath: '/static/images/tabbar/home.png',
selectedIconPath: '/static/images/tabbar/home-sel.png',
text: '销售明细',
active: false
},{
iconPath: '/static/images/tabbar/home.png',
selectedIconPath: '/static/images/tabbar/home-sel.png',
text: '入库明细',
active: false
}]
}
},
filters: {
@ -127,6 +142,22 @@
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd;
},
//悬浮按钮
trigger(e) {
console.log(e.index==0)
// this.content[e.index].active = !e.item.active
//e.item.text
if(e.index==0){ //销售明细
uni.navigateTo({
url: '/pages/inventory/getProductIdToList?id=' + this.dataList.id
})
}else{
// uni.navigateTo({
// url: `/pages/other/logisticsAddress`
// })
}
},
}
}

1
pages/other/custom.vue

@ -120,7 +120,6 @@
dateChange(e) {
console.log(e)
if(e.length == 0){
console.log("11111")
this.query.startDate = ''
this.query.endDate = ''
}else{

Loading…
Cancel
Save