Commit b4e2af90 authored by Facius's avatar Facius

我的仓库初步搭建

parent 73936f54
...@@ -261,6 +261,14 @@ ...@@ -261,6 +261,14 @@
"navigationBarTitleText": "我的仓库", "navigationBarTitleText": "我的仓库",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path": "warehouse/records",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "操作记录",
"enablePullDownRefresh": false
}
}, },
{ {
"path": "superLogin/index", "path": "superLogin/index",
......
...@@ -148,18 +148,12 @@ ...@@ -148,18 +148,12 @@
methods: { methods: {
sectionChange(index) { sectionChange(index) {
this.curNow = index; this.curNow = index;
this.pageNumber = 0 this.reloadOrderList()
this.orderList = []
this.loadStatus = 'loading'
this.getOrderList(this.currentIndex)
}, },
// tab栏切换 // tab栏切换
change(index) { change(index) {
this.current = index; this.current = index;
this.pageNumber = 0 this.reloadOrderList()
this.orderList = []
this.loadStatus = 'loading'
this.getOrderList(index);
}, },
reachBottom(e) { reachBottom(e) {
...@@ -271,10 +265,12 @@ ...@@ -271,10 +265,12 @@
this.triggered = 'restore'; // 需要重置 this.triggered = 'restore'; // 需要重置
}, },
reloadOrderInfo() { reloadOrderInfo() {
this.reloadOrderList()
this.getOrderCount();
},
reloadOrderList() {
this.pageNumber = 0 this.pageNumber = 0
this.orderList = []
this.loadStatus = 'loading' this.loadStatus = 'loading'
this.getOrderCount();
this.getOrderList(this.currentIndex); this.getOrderList(this.currentIndex);
}, },
scroll(e) { scroll(e) {
...@@ -290,181 +286,11 @@ ...@@ -290,181 +286,11 @@
}; };
</script> </script>
<style>
/* #ifndef H5 */
page {
height: 100%;
background-color: #f2f2f2;
}
/* #endif */
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
.u-tabs-box { .u-tabs-box {
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.order {
.top {
display: flex;
justify-content: space-between;
align-items: center;
.left {
display: flex;
align-items: center;
.tag {
text-align: center;
width: 84rpx;
height: 40rpx;
background: linear-gradient(270deg, #47ABFF 0%, #2272FF 100%);
border-radius: 8rpx;
font-size: 22rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 40rpx;
}
.store {
margin: 0 10rpx;
font-size: 36rpx;
font-weight: bold;
color: #333333;
line-height: 36px;
}
}
.right {
height: 40rpx;
background: #F4F5F7;
border-radius: 22rpx;
padding: 8rpx 16rpx 8rpx 16rpx;
font-size: 22rpx;
line-height: 24rpx;
font-weight: 400;
color: #333333;
}
}
.item {
display: flex;
flex-direction: column;
margin: 20rpx 0 0;
.content {
.title {
font-size: 26rpx;
font-weight: 400;
color: #333333;
line-height: 52rpx;
}
}
.address {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24rpx;
font-weight: 400;
color: #333333;
line-height: 52rpx;
.left {}
.right {}
}
}
.total {
margin-top: 20rpx;
text-align: right;
font-size: 24rpx;
.total-price {
font-size: 32rpx;
}
}
.bottom {
display: flex;
margin-top: 30rpx;
padding: 0 10rpx;
justify-content: space-between;
align-items: center;
.left {
display: flex;
align-items: center;
justify-content: space-between;
.tag {
text-align: center;
width: 54rpx;
height: 54rpx;
background: #FF930D;
font-size: 26rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 54rpx;
border-radius: 50%;
margin-right: 20rpx;
}
}
.right-btn {
text-align: center;
width: 200rpx;
height: 80rpx;
background: #2272FF;
border-radius: 40rpx;
font-size: 32rpx;
font-weight: 600;
color: #FFFFFF;
line-height: 80rpx;
font-family: PingFangSC-Semibold, PingFang SC;
}
}
}
.centre {
text-align: center;
margin: 200rpx auto;
font-size: 32rpx;
image {
width: 164rpx;
height: 164rpx;
border-radius: 50%;
margin-bottom: 20rpx;
}
.tips {
font-size: 24rpx;
color: #999999;
margin-top: 20rpx;
}
.btn {
margin: 80rpx auto;
width: 200rpx;
border-radius: 32rpx;
line-height: 64rpx;
color: #ffffff;
font-size: 26rpx;
background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%);
}
}
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top));
width: 100%;
}
.tab-view { .tab-view {
height: 100%; height: 100%;
overflow: auto; overflow: auto;
...@@ -509,34 +335,4 @@ ...@@ -509,34 +335,4 @@
} }
} }
} }
.order-taps {
height: 80rpx;
padding: 8rpx 30rpx 20rpx 30rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
.order-taps-item {
font-size: 28rpx;
font-weight: 400;
color: #999999;
line-height: 20px;
.taps-count {
position: absolute;
font-size: 16rpx;
font-weight: 400;
line-height: 16rpx;
width: 36rpx;
height: 24rpx;
background: #FFFFFF;
border-radius: 16rpx;
border: 2rpx solid #FA5A49;
text-align: center;
color: #FA5A49;
}
}
}
</style> </style>
<template> <template>
<view class="ware-wrap"> <view class="ware-house">
<w-navbar title="我的仓库" :background="{backgroundColor: '#F4F5F7'}"></w-navbar> <u-navbar back-icon-color="#333333" background="#FFFFFF" title="我的仓库" titleColor="#333333"
<view class="content"> :border-bottom="false" title-bold></u-navbar>
<view class="panel"> <view class="tools-box">
<view class="title">物料明细</view> <view class="search-sub">
<view class="item-table"> <u-subsection :current="curNow" :list="subList" active-color="white" bg-color="white"
<view class="item-header"> inactive-color="#666" button-color="#2272FF" bparts-radius="36" @change="sectionChange" height="72"
<view>物料名称</view> bold>
<view>库存数量</view> </u-subsection>
</view>
<u-divider half-width="315" border-color="#F4F5F7" height="2"></u-divider>
<view class="item-row" v-for="(item, index) in details" :key="index">
<view class="width-504 break">{{ item.skuName }}</view>
<view class="width-106 center">{{ item.systemStock }}</view>
</view>
</view>
</view> </view>
<view class="panel"> <u-button class="right-btn" @click="handleClickRecords" :custom-style="buttonStyle" type="primary"
<view class="title">操作记录</view> shape="circle">操作记录</u-button>
<view class="item-table"> <view class="search-btn" @click="handleClickSearch">
<view class="item-header"> <image class="search-image" mode="widthFix" :src="sousuoImage"></image>
<view class="width-132">订单编号</view> <text class="search-btn-text">搜索</text>
<view class="width-210">物料名称</view> </view>
<view class="width-80">出库量</view> </view>
<view class="width-140 right">操作时间</view> <view class="u-tabs-box">
</view> <u-tabs height="66" activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4"
<u-divider half-width="315" border-color="#F4F5F7" height="2"></u-divider> bar-width="44" :offset="[0,0]" :list="list[curNow]" count="total" :current="current[curNow]" @change="change"
<view class="item-row" v-for="(item, index) in record" :key="index"> :is-scroll="false" font-size="28" bold></u-tabs>
<view class="width-132 break">{{ item.businessNumber }}</view> </view>
<view class="width-210 break">{{ item.skuName }}</view>
<view class="width-80 center">{{ item.outAmount }}</view> <view class="tab-view">
<view class="width-140 create-time">{{ (item.updateTime || item.createTime) | datefmt('YYYY.MM.DD HH:mm:ss')}}</view> <scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring
</view> refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
<u-loadmore margin-top="20" :status="status" @loadmore="loadRecord" /> :scroll-top="scrollTop" refresher-background="#F4F5F7" @refresherpulling="triggered = true"
</view> @refresherrefresh="onRefresh" @refresherrestore="onRestore" @scroll="scroll" enable-back-to-top>
</view> <NoOrder v-if="noMore" type="black" :customStyle="noPartsCustomStyle" />
</view> <template v-else>
</view> <view v-for="(item, index) in partsList" :key="item.id">
</template> <AppliedCell @operate="handleOperate" :info="item"></AppliedCell>
</view>
<script> <view class="load-more-view">
export default { <u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 2" :status="loadStatus"
data() { bgColor="#F4F5F7"></u-loadmore>
return { </view>
status: 'loadmore', </template>
details: [], </scroll-view>
record: [], </view>
total: 100, </view>
search: { </template>
pageNumber: 0,
pageSize: 10, <script>
}, import AppliedCell from "@/components/parts/appliedPartsCell.vue"
}; import NoOrder from "@/components/order/noOrder.vue"
},
onReachBottom() { export default {
if(this.status == 'nomore') return ; components: {
this.status = 'loading'; AppliedCell,
this.search.pageNumber = ++ this.search.pageNumber; NoOrder
this.loadAccess() },
}, data() {
computed: {}, return {
onLoad() { curNow: 0,
getApp().trackPage('我的仓库列表页') pageNumber: 0,
this.getData(); pageSize: 100,
}, partsList: [],
methods: { current: [0, 0],
getData() { loadStatus: 'loading',
let self = this dataValue: [],
self.initDetails() loaded: false,
self.loadAccess() triggered: false,
}, _freshing: false,
async initDetails() { scrollTop: 0,
let self = this old: {
let res = await self.$u.api.listBystock() scrollTop: 0
if(res && res.code == 200) { }
self.details = res.data };
} },
}, computed: {
loadRecord() { // -1 已驳回,-1 已取消,0 新申请,1 待审核,10 待发货,11 配货中,12 采购中,15 已发货,20 已签收,21 待返件,22 返件中,90 已转备件,100 已完成
if(this.status == 'nomore') return ; list() {
this.status = 'loading'; return [
this.search.pageNumber = ++ this.search.pageNumber; [{
this.loadAccess() 'name': '代签收',
}, 'status': ''
async loadAccess() { },
let self = this {
let res = await self.$u.api.listAccessHistory(self.search) 'name': '代发货',
if(res && res.code == 200) { 'status': ''
self.total = res.data && res.data.total || self.total },
let list = res.data && res.data.list && self.$u.deepClone(res.data.list) || []; {
if(list && list.length) { 'name': '代审核',
self.record.push(...list) 'status': ''
if(self.total > self.record.length) { },
self.status = "loadmore" {
} else { 'name': '已取消',
self.status = "nomore" 'status': ''
} },
} else { {
self.status = "nomore" 'name': '已签收',
} 'status': ''
} else { }
self.status = "nomore" ],
} [{
}, 'name': '备件仓',
} 'status': ''
} },
</script> {
'name': '已返件',
<style lang="scss" scoped> 'status': ''
.ware-wrap { }
background-color: #F4F5F7; ]
.content { ]
padding: 34rpx 30rpx; },
display: flex; subList() {
flex-direction: column; return ['未入库', '已入库']
align-items: center; },
.panel { currentTab() {
.title { return this.list[this.curNow][this.current[this.curNow]]
margin-bottom: 30rpx; },
font-size: 32rpx; sousuoImage() {
font-weight: bold; return process.uniEnv.qn_base_url + 'sousuo.png'
color: #333333; },
line-height: 44rpx; noMore() {
} return this.partsList.length == 0 && this.loaded
.item-table { },
margin-bottom: 46rpx; noPartsCustomStyle() {
padding: 34rpx 30rpx; return this.curNow == 0 ? 'margin-top: 100rpx;background-color: #F4F5F7' :
width: 690rpx; 'margin-top: 200rpx;background-color: #F4F5F7'
background: #FFFFFF; },
border-radius: 12rpx; buttonStyle() {
.item-header { return {
margin-bottom: 24rpx; 'background-color': '#2272FF',
font-size: 26rpx; 'color': '#FFFFFF',
font-weight: bold; 'font-size': '32rpx',
color: #333333; 'height': '80rpx',
line-height: 38rpx; 'width': '200rpx'
display: flex;
justify-content: space-between;
}
.item-row {
margin: 24rpx 0;
font-size: 26rpx;
font-weight: 400;
color: #333333;
line-height: 38rpx;
display: flex;
justify-content: space-between;
.create-time {
letter-spacing: 0.03rpx
}
} }
} }
} },
} onLoad(e) {
} getApp().trackPage('我的仓库列表页')
.width-504 { this._freshing = false;
width: 504rpx; },
} onShow() {
.width-106 { this.reloadPartsInfo()
width: 106rpx; },
} methods: {
.width-132 { sectionChange(index) {
width: 132rpx; this.curNow = index;
} this.reloadPartsList()
.width-210 { },
width: 210rpx; // tab栏切换
} change(index) {
.width-80 { this.current[this.curNow] = index;
width: 80rpx; this.reloadPartsList()
} },
.width-140 {
width: 140rpx; reachBottom(e) {
} if (this.loadStatus != 'loadmore') return
.center { this.loadStatus == 'loading'
text-align: center; this.getPartsList(this.currentTab)
} },
.right { // 页面数据
text-align: right; getPartsList(index) {
} // 状态处理
.break { this.pageNumber += 1
word-break:break-all; this.loaded = false
} var param = {
pageNumber: this.pageNumber,
pageSize: this.pageSize,
keyword: '',
type: 0
}
var self = this;
self.$u.api.listBystock(param).then((res) => {
if (res.code == 200) {
if (res.data.type != self.partsType) return
self.triggered = false;
self._freshing = false;
if (self.pageNumber == 1) {
self.partsList = []
}
if (res.data.list) {
self.partsList.push(...res.data.list)
self.loadStatus = res.data.total > self.partsList.length && res.data.list.length ==
self.pageSize ? 'loadmore' : 'nomore'
}
} else {
console.log(res.message, "获取订单数量失败!");
}
this.loaded = true
});
},
handleOperate(type) {
// 调接口
// 刷新页面
},
handleClickRecords() {
uni.navigateTo({
url: 'pages/mine/warehouse/records'
})
},
handleClickSearch() {
uni.navigateTo({
url: 'pages/order/search'
})
},
onRefresh() {
if (this._freshing) return;
this._freshing = true;
this.reloadPartsInfo()
},
onRestore() {
this.triggered = 'restore'; // 需要重置
},
reloadPartsInfo() {
this.reloadPartsList()
},
reloadPartsList() {
this.pageNumber = 0
this.loadStatus = 'loading'
this.getPartsList(this.currentTab);
},
scroll(e) {
this.old.scrollTop = e.detail.scrollTop
},
}
};
</script>
<style lang="scss" scoped>
.ware-house {
.u-tabs-box {
margin-bottom: 30rpx;
}
.tab-view {
height: 100%;
overflow: auto;
.load-more-view {
margin-bottom: 20rpx;
}
}
.tools-box {
display: flex;
flex-direction: row;
justify-content: space-between;
padding-bottom: 20rpx;
.search-sub {
height: 72rpx;
width: 320rpx;
}
.search-btn {
height: 72rpx;
width: 220rpx;
background-color: #ffffff;
border-radius: 36rpx;
color: #999999;
display: flex;
justify-content: center;
align-items: center;
.search-image {
width: 36rpx;
height: 32rpx;
flex-shrink: 0;
margin-right: 24rpx;
}
.search-btn-text {
line-height: 36rpx;
font-weight: 400;
font-size: 26rpx;
}
}
}
}
</style> </style>
<template>
<view class="ware-wrap">
<w-navbar title="操作记录" :background="{backgroundColor: '#F4F5F7'}"></w-navbar>
<view class="content">
<view class="panel">
<view class="title">物料明细</view>
<view class="item-table">
<view class="item-header">
<view>物料名称</view>
<view>库存数量</view>
</view>
<u-divider half-width="315" border-color="#F4F5F7" height="2"></u-divider>
<view class="item-row" v-for="(item, index) in details" :key="index">
<view class="width-504 break">{{ item.skuName }}</view>
<view class="width-106 center">{{ item.systemStock }}</view>
</view>
</view>
</view>
<view class="panel">
<view class="title">操作记录</view>
<view class="item-table">
<view class="item-header">
<view class="width-132">订单编号</view>
<view class="width-210">物料名称</view>
<view class="width-80">出库量</view>
<view class="width-140 right">操作时间</view>
</view>
<u-divider half-width="315" border-color="#F4F5F7" height="2"></u-divider>
<view class="item-row" v-for="(item, index) in record" :key="index">
<view class="width-132 break">{{ item.businessNumber }}</view>
<view class="width-210 break">{{ item.skuName }}</view>
<view class="width-80 center">{{ item.outAmount }}</view>
<view class="width-140 create-time">{{ (item.updateTime || item.createTime) | datefmt('YYYY.MM.DD HH:mm:ss')}}</view>
</view>
<u-loadmore margin-top="20" :status="status" @loadmore="loadRecord" />
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
status: 'loadmore',
details: [],
record: [],
total: 100,
search: {
pageNumber: 0,
pageSize: 10,
},
};
},
onReachBottom() {
if(this.status == 'nomore') return ;
this.status = 'loading';
this.search.pageNumber = ++ this.search.pageNumber;
this.loadAccess()
},
computed: {},
onLoad() {
getApp().trackPage('我的仓库-操作记录')
this.getData();
},
methods: {
getData() {
let self = this
self.initDetails()
self.loadAccess()
},
async initDetails() {
let self = this
let res = await self.$u.api.listBystock()
if(res && res.code == 200) {
self.details = res.data
}
},
loadRecord() {
if(this.status == 'nomore') return ;
this.status = 'loading';
this.search.pageNumber = ++ this.search.pageNumber;
this.loadAccess()
},
async loadAccess() {
let self = this
let res = await self.$u.api.listAccessHistory(self.search)
if(res && res.code == 200) {
self.total = res.data && res.data.total || self.total
let list = res.data && res.data.list && self.$u.deepClone(res.data.list) || [];
if(list && list.length) {
self.record.push(...list)
if(self.total > self.record.length) {
self.status = "loadmore"
} else {
self.status = "nomore"
}
} else {
self.status = "nomore"
}
} else {
self.status = "nomore"
}
},
}
}
</script>
<style lang="scss" scoped>
.ware-wrap {
background-color: #F4F5F7;
.content {
padding: 34rpx 30rpx;
display: flex;
flex-direction: column;
align-items: center;
.panel {
.title {
margin-bottom: 30rpx;
font-size: 32rpx;
font-weight: bold;
color: #333333;
line-height: 44rpx;
}
.item-table {
margin-bottom: 46rpx;
padding: 34rpx 30rpx;
width: 690rpx;
background: #FFFFFF;
border-radius: 12rpx;
.item-header {
margin-bottom: 24rpx;
font-size: 26rpx;
font-weight: bold;
color: #333333;
line-height: 38rpx;
display: flex;
justify-content: space-between;
}
.item-row {
margin: 24rpx 0;
font-size: 26rpx;
font-weight: 400;
color: #333333;
line-height: 38rpx;
display: flex;
justify-content: space-between;
.create-time {
letter-spacing: 0.03rpx
}
}
}
}
}
}
.width-504 {
width: 504rpx;
}
.width-106 {
width: 106rpx;
}
.width-132 {
width: 132rpx;
}
.width-210 {
width: 210rpx;
}
.width-80 {
width: 80rpx;
}
.width-140 {
width: 140rpx;
}
.center {
text-align: center;
}
.right {
text-align: right;
}
.break {
word-break:break-all;
}
</style>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</view> </view>
</view> </view>
<!-- 订单详情 --> <!-- 订单详情 -->
<view class="card base-item"> <view class="card">
<Detail :order="order" :readMore.sync="readMore" :operate="isAllowDianhuaAndDaohang"></Detail> <Detail :order="order" :readMore.sync="readMore" :operate="isAllowDianhuaAndDaohang"></Detail>
</view> </view>
<!-- 从我的页面进来显示结算信息 --> <!-- 从我的页面进来显示结算信息 -->
...@@ -343,7 +343,7 @@ ...@@ -343,7 +343,7 @@
} }
}, },
onShow() { onShow() {
// 从标签列表页面返回,获取选中的标签 // 从过程反馈回来,需要刷新数据
let pages = getCurrentPages() let pages = getCurrentPages()
let page = pages[pages.length - 1] let page = pages[pages.length - 1]
if (page.needFresh) { if (page.needFresh) {
...@@ -980,96 +980,6 @@ ...@@ -980,96 +980,6 @@
padding: 0; padding: 0;
} }
} }
.toolbar {
margin-bottom: 44rpx;
display: flex;
justify-content: center;
align-items: center;
.left {
width: 100rpx;
height: 100rpx;
.button {
width: 100rpx;
height: 100rpx;
background: #929CB8;
border-radius: 100rpx;
font-weight: bold;
display: flex;
text-align: center;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #FFFFFF;
}
}
.center {
width: 140rpx;
height: 140rpx;
margin-left: 74rpx;
margin-right: 74rpx;
.center-button-view {
width: 140rpx;
height: 140rpx;
border-radius: 100rpx;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
color: #FFFFFF;
font-size: 32rpx;
font-weight: bold;
.time-view {
display: flex;
font-size: 20rpx;
color: #FFFFFF;
align-items: center;
justify-content: space-around;
}
}
.appoint-btn {
background: #2272FF;
box-shadow: 2px 2px 20px 0px rgba(34, 114, 255, 0.3);
}
.isGan-btn {
background: #D1D4D4;
box-shadow: 2px 2px 20px 0px rgba(181, 181, 181, 0.3);
}
.timeOut-btn {
background: #FA5A49;
box-shadow: 2px 2px 20px 0px rgba(232, 101, 82, 0.3);
}
}
.right {
width: 100rpx;
height: 100rpx;
.button {
width: 100rpx;
height: 100rpx;
background-color: #929CB8;
border-radius: 100rpx;
font-size: 28rpx;
font-weight: bold;
align-items: center;
display: flex;
color: #FFFFFF;
justify-content: center;
&.active {
background-color: #FF930D;
}
}
}
}
} }
.settlement-view { .settlement-view {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment