Commit 61cab7de authored by Facius's avatar Facius

feat: 前端-16、小程序端去掉合计这项,后台 “单位”这个字段改为必填项。

parent fb64824f
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
overflow-x: auto; overflow-x: auto;
display: flex; display: flex;
width: 100%; width: 100%;
border-right: 2rpx solid #F4F5F7; // border-right: 2rpx solid #F4F5F7;
.image-view { .image-view {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
<view class="bottom-view"> <view class="bottom-view">
<view class="total-view"> <view class="total-view">
<text>合计:</text> <text>合计:</text>
<text class="amount-view">x{{total}}</text> <text class="amount-view">x{{info.items.length}}</text>
<text></text> <text></text>
</view> </view>
</view> </view>
</view> </view>
...@@ -63,13 +63,13 @@ ...@@ -63,13 +63,13 @@
} }
return this.info.finished ? '退件完成' : text return this.info.finished ? '退件完成' : text
}, },
total() { // 合计 // total() { // 合计
var i = 0 // var i = 0
for (var item of this.info.items) { // for (var item of this.info.items) {
i += item.quantity // i += item.quantity
} // }
return i // return i
}, // },
}, },
methods: { methods: {
handleLongpress() { // 长按复制单号 handleLongpress() { // 长按复制单号
......
...@@ -4,17 +4,20 @@ ...@@ -4,17 +4,20 @@
<u-checkbox v-if="showChecked" icon-size="28" size="40" v-model="check" @change="handleChange" <u-checkbox v-if="showChecked" icon-size="28" size="40" v-model="check" @change="handleChange"
shape="circle" /> shape="circle" />
<image class="image-view" :src="imageUrl"></image> <image class="image-view" :src="imageUrl"></image>
<view class="info-view">
<view class="name-text">{{item.name}}</view>
<view>{{remarkText}}</view>
</view>
</view> </view>
<view class="count-view"> <view class="info-view">
<view v-if="showChecked"> <view class="name-text">{{item.name}}</view>
<u-number-box v-model="value" :min="item.min || 0" :max="item.max || item[type]" @minus="numChange" <view class="info-bottom">
@plus="numChange" @blur="numChange"></u-number-box> <view>{{remarkText}}</view>
</view> <view class="count-view">
<text v-else>x{{item[type]|| 0}}</text> <view v-if="showChecked">
<u-number-box v-model="value" :min="item.min || 0" :max="item.max || item[type]" @minus="numChange"
@plus="numChange" @blur="numChange"></u-number-box>
</view>
<text v-else>x{{item[type]|| 0}}</text>
<text class="unit-text" v-if="item.unit">{{item.unit}}</text>
</view>
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -66,23 +69,23 @@ ...@@ -66,23 +69,23 @@
}, },
}, },
watch: { watch: {
'item.quantity'(val) { 'item.quantity'(val) {
this.check = val > 0 this.check = val > 0
this.value = val this.value = val
}, },
'item.selected'(val) { 'item.selected'(val) {
this.check = val this.check = val
this.value = val ? this.item.stock : 0 this.value = val ? this.item.stock : 0
}, },
}, },
methods: { methods: {
handleChange(event) { handleChange(event) {
this.value = event.value ? this.item.stock : 0 this.value = event.value ? this.item.stock : 0
this.$emit('change', event.value) this.$emit('change', event.value)
this.$emit('numChange', this.value) this.$emit('numChange', this.value)
}, },
numChange(event) { numChange(event) {
this.check = event.value > 0 this.check = event.value > 0
this.$emit('change', this.check) this.$emit('change', this.check)
this.$emit('numChange', event.value) this.$emit('numChange', event.value)
}, },
...@@ -93,8 +96,7 @@ ...@@ -93,8 +96,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.spare-item { .spare-item {
display: flex; display: flex;
justify-content: space-between; align-items: center;
align-items: flex-end;
.left-view { .left-view {
display: flex; display: flex;
...@@ -106,24 +108,33 @@ ...@@ -106,24 +108,33 @@
margin-right: 20rpx; margin-right: 20rpx;
flex-shrink: 0; flex-shrink: 0;
} }
}
.info-view { .info-view {
font-size: 24rpx; font-size: 24rpx;
color: #333333;
width: 100%;
.name-text {
font-size: 32rpx;
font-weight: bold;
color: #333333; color: #333333;
margin-bottom: 30rpx;
.name-text { }
font-size: 32rpx; .info-bottom {
font-weight: bold; display: flex;
justify-content: space-between;
align-items: center;
.count-view {
font-size: 28rpx;
color: #333333; color: #333333;
margin-bottom: 30rpx; display: flex;
justify-content: flex-end;
align-items: center;
.unit-text {
padding-left: 10rpx;
}
} }
} }
} }
.count-view {
font-size: 28rpx;
color: #333333;
}
} }
</style> </style>
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<view class="num"> <view class="num">
<u-number-box v-if="!disabled" v-model="info.quantity" :min="info.min || 0" :max="info.max || 9999" @change="numChange" @minus="minusValue" @blur="minusValue"></u-number-box> <u-number-box v-if="!disabled" v-model="info.quantity" :min="info.min || 0" :max="info.max || 9999" @change="numChange" @minus="minusValue" @blur="minusValue"></u-number-box>
<text class="nums" v-else>x{{ info.quantity || 1 }}</text> <text class="nums" v-else>x{{ info.quantity || 1 }}</text>
<text v-if="info.unit" class="unit-text">{{info.unit || ''}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -54,9 +55,15 @@ ...@@ -54,9 +55,15 @@
.num { .num {
width: 200rpx; width: 200rpx;
text-align: center; text-align: center;
display: flex;
justify-content: flex-end;
align-items: center;
.nums { .nums {
//color: #F59A23; //color: #F59A23;
} }
.unit-text {
padding-left: 10rpx;
}
} }
} }
} }
......
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
<view class="right-content-desc u-line-2">{{ info.remark }}</view> <view class="right-content-desc u-line-2">{{ info.remark }}</view>
<view class="u-flex right-content-opera"> <view class="u-flex right-content-opera">
<view class="no" v-if="maxShow"> <view class="no" v-if="maxShow">
可用{{ info.max }} 可用{{ info.max + (info.unit || '')}}
</view> </view>
<view class="num"> <view class="num">
<u-number-box v-show="!info.disabled" v-model="info.quantity" :min="info.min || 0" :max="info.max || info.quantity" @change="numChange"></u-number-box> <u-number-box v-show="!info.disabled" v-model="info.quantity" :min="info.min || 0" :max="info.max || info.quantity" @change="numChange"></u-number-box>
<text v-show="!maxShow && !info.disabled && info.unit" class="unit-text">{{info.unit}}</text>
<u-button v-show="info.disabled" type="primary" size="mini" shape="circle" @click="addApply">加入申请</u-button> <u-button v-show="info.disabled" type="primary" size="mini" shape="circle" @click="addApply">加入申请</u-button>
</view> </view>
</view> </view>
...@@ -121,6 +122,12 @@ ...@@ -121,6 +122,12 @@
.num { .num {
flex: 1; flex: 1;
text-align: right; text-align: right;
display: flex;
justify-content: flex-end;
align-items: center;
.unit-text {
padding-left: 10rpx;
}
} }
} }
} }
......
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
<view class="left-list">全选</view> <view class="left-list">全选</view>
</view> </view>
<view class="u-flex bottom-center"> <view class="u-flex bottom-center">
<view class="center-list">已选择 {{ partNum }}</view> <view class="center-list">共:<text class="num"> {{ partNum }} </text></view>
<view class="center-list">共:<text class="num"> {{ num }} </text></view>
</view> </view>
</view> </view>
<view class="u-flex select-num" v-if="!showChecked"> <view class="u-flex select-num" v-if="!showChecked">
...@@ -15,7 +14,7 @@ ...@@ -15,7 +14,7 @@
<u-badge type="error" :show-zero="true" :count="partNum" :offset="[0, 0]"></u-badge> <u-badge type="error" :show-zero="true" :count="partNum" :offset="[0, 0]"></u-badge>
<u-image width="72rpx" height="72rpx" :lazy-load="false" :src="partsImage"></u-image> <u-image width="72rpx" height="72rpx" :lazy-load="false" :src="partsImage"></u-image>
</view> </view>
<view class="num-right">共:<text class="num"> {{ num }} </text></view> <view class="num-right">共:<text class="num"> {{ partNum }} </text></view>
</view> </view>
<view class="u-flex bottom-right"> <view class="u-flex bottom-right">
<button :class="['btn', btnActive]" @click="submit">{{ submitTxt }}</button> <button :class="['btn', btnActive]" @click="submit">{{ submitTxt }}</button>
...@@ -143,14 +142,14 @@ ...@@ -143,14 +142,14 @@
align-items: flex-start; align-items: flex-start;
margin-right: 20rpx; margin-right: 20rpx;
.center-list { .center-list {
// &:nth-of-type(1) {
// color: #666;
// font-size: 26rpx;
// }
&:nth-of-type(1) { &:nth-of-type(1) {
color: #666;
font-size: 26rpx;
}
&:nth-of-type(2) {
color: #333; color: #333;
font-size: 32rpx; font-size: 32rpx;
margin-top: 8rpx; // margin-top: 8rpx;
font-weight: bold; font-weight: bold;
.num { .num {
color: #2272FF; color: #2272FF;
......
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
<view class="tab-view"> <view class="tab-view">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring <scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring
refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" @scroll="scroll" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" @scroll="scroll"
:scroll-top="scrollTop" refresher-background="#F4F5F7" refresher-background="#F4F5F7" @refresherrefresh="onRefresh" @refresherrestore="onRestore" enable-back-to-top>
@refresherrefresh="onRefresh" @refresherrestore="onRestore" enable-back-to-top>
<!-- 加载中 && 没有下拉:显示加载中 --> <!-- 加载中 && 没有下拉:显示加载中 -->
<view class="loading-view" v-if="!loaded && _freshing"> <view class="loading-view" v-if="!loaded && _freshing">
<u-loading mode="flower"></u-loading> <u-loading mode="flower"></u-loading>
...@@ -35,7 +34,7 @@ ...@@ -35,7 +34,7 @@
<AppliedCell @operate="handleOperate" :info="item" @action="handleClickCell" @express="handleClickExpress"></AppliedCell> <AppliedCell @operate="handleOperate" :info="item" @action="handleClickCell" @express="handleClickExpress"></AppliedCell>
</view> </view>
<!-- 底部加载状态 --> <!-- 底部加载状态 -->
<view class="load-more-view" v-if="(pageNumber == 1 && loaded) || pageNumber > 1"> <view class="load-more-view" v-show="(pageNumber == 1 && loaded) || pageNumber > 1">
<u-loadmore :status="loadStatus" <u-loadmore :status="loadStatus"
bgColor="#F4F5F7"></u-loadmore> bgColor="#F4F5F7"></u-loadmore>
</view> </view>
...@@ -99,7 +98,7 @@ ...@@ -99,7 +98,7 @@
{ {
'name': '全部', 'name': '全部',
'status': null 'status': null
} },
] ]
}, },
// 当下tab // 当下tab
......
<template> <template>
<!-- 返件信息 --> <!-- 返件信息 -->
<view class="ware-house-return"> <view class="ware-house-return">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="返件信息" titleColor="#333333" <u-navbar back-icon-color="#333333" background="#FFFFFF" title="返件信息" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar> :border-bottom="false" title-bold></u-navbar>
<view class="search-view"> <view class="search-view">
<u-search v-model="keyword" :action-text="searchButtonText" @search="handleClickSearch" @clear="handleClear" <u-search v-model="keyword" :action-text="searchButtonText" @search="handleClickSearch" @clear="handleClear"
@custom="handleClickButton" placeholder="请输入关键字" :action-style="actionStyle" placeholder-color="#999999" @custom="handleClickButton" placeholder="请输入关键字" :action-style="actionStyle" placeholder-color="#999999"
color="#333333" bg-color="#FFFFFF" height="72" search-icon-color="#999999"> color="#333333" bg-color="#FFFFFF" height="72" search-icon-color="#999999">
</u-search> </u-search>
</view> </view>
<NoOrder v-if="noParts" imageName="wupeijianxinxi.png" text="当前暂无返件信息" :customStyle="noPartsCustomStyle" /> <NoOrder v-if="noParts" imageName="wupeijianxinxi.png" text="当前暂无返件信息" :customStyle="noPartsCustomStyle" />
<view v-else class="tab-view"> <view v-else class="tab-view">
<scroll-view scroll-y style="height: 100%;width: 100%;" scroll-anchoring enable-back-to-top> <scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring enable-back-to-top>
<view class="loading-view" v-if="!loaded"> <view class="loading-view" v-if="!loaded">
<u-loading mode="flower"></u-loading> <u-loading mode="flower"></u-loading>
</view> </view>
<template v-else> <template v-else>
<view v-for="(item, index) in partsList" :key="item.id"> <view v-for="item in partsList" :key="item.id">
<ReturnCell :info="item"></ReturnCell> <ReturnCell :info="item"></ReturnCell>
</view> </view>
<view class="load-more-view"> <view class="load-more-view" v-if="(pageNumber == 1 && loaded) || pageNumber > 1">
<u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 1" :status="loadStatus" <u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
bgColor="#F4F5F7"></u-loadmore>
</view> </view>
</template> </template>
</scroll-view> </scroll-view>
...@@ -44,8 +43,8 @@ ...@@ -44,8 +43,8 @@
pageSize: 20, pageSize: 20,
partsList: [], partsList: [],
loadStatus: 'loading', loadStatus: 'loading',
loaded: false, loaded: false,
keyword: '', keyword: '',
searchedKeyword: '' searchedKeyword: ''
}; };
}, },
...@@ -58,45 +57,45 @@ ...@@ -58,45 +57,45 @@
}, },
noPartsCustomStyle() { noPartsCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7' return 'margin-top: 100rpx;background-color: #F4F5F7'
}, },
searchButtonText() { searchButtonText() {
return this.searchedKeyword == this.keyword && this.keyword ? '取消' : '搜索' return this.searchedKeyword == this.keyword && this.keyword ? '取消' : '搜索'
}, },
actionStyle() { actionStyle() {
return { return {
'font-size': '32rpx', 'font-size': '32rpx',
'color': '#2272FF', 'color': '#2272FF',
'margin-left': '20rpx' 'margin-left': '20rpx'
} }
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('我的配件页') getApp().trackPage('我的配件页')
this.reloadPartsList() this.reloadPartsList()
}, },
methods: { methods: {
getReturnedParts() { // 返件列表 getReturnedParts() { // 返件列表
this.pageNumber += 1 this.pageNumber += 1
if (this.pageNumber == 1) { if (this.pageNumber == 1) {
this.loaded = false this.loaded = false
} }
var param = { var param = {
'pageSize': this.pageSize, 'pageSize': this.pageSize,
'pageNumber': this.pageNumber, 'pageNumber': this.pageNumber,
'items': true, 'items': true,
'type': 'new' 'type': 'new'
} }
if (this.keyword) { if (this.keyword) {
param.keyword = this.keyword param.keyword = this.keyword
} }
this.searchedKeyword = this.keyword this.searchedKeyword = this.keyword
this.$u.api.returnedParts(param).then((res) => { this.$u.api.returnedParts(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (this.pageNumber == 1) { if (this.pageNumber == 1) {
this.partsList = [] this.partsList = []
} }
let list = res.data || [] let list = res.data || []
this.partsList.push(...list) this.partsList.push(...list)
this.loadStatus = list.length < this.pageSize ? 'nomore' : 'loadmore' this.loadStatus = list.length < this.pageSize ? 'nomore' : 'loadmore'
} else { } else {
console.log(res.message) console.log(res.message)
...@@ -104,44 +103,44 @@ ...@@ -104,44 +103,44 @@
this.loaded = true this.loaded = true
}); });
}, },
handleClickCell(info) { handleClickCell(info) {
var pages = getCurrentPages(); var pages = getCurrentPages();
if (pages.length >= 1) { if (pages.length >= 1) {
var page = pages[pages.length - 1]; var page = pages[pages.length - 1];
page.info = info page.info = info
} }
uni.navigateTo({ uni.navigateTo({
url: 'pages/mine/warehouse/partsDetail' url: 'pages/mine/warehouse/partsDetail'
}) })
}, },
handleClickSearch() { // 软键盘搜索 handleClickSearch() { // 软键盘搜索
this.reloadPartsList() this.reloadPartsList()
}, },
handleClear() { // 清空搜索 handleClear() { // 清空搜索
if (this.searchedKeyword) { if (this.searchedKeyword) {
this.reloadPartsList() this.reloadPartsList()
} }
}, },
handleClickButton() { // 点了搜索按钮 handleClickButton() { // 点了搜索按钮
if (this.searchedKeyword == this.keyword) { if (this.searchedKeyword == this.keyword) {
this.keyword = '' this.keyword = ''
} }
this.reloadPartsList() this.reloadPartsList()
}, },
onRestore() { onRestore() {
this.triggered = 'restore'; // 需要重置 this.triggered = 'restore'; // 需要重置
}, },
reloadPartsList() { // 第一页数据 reloadPartsList() { // 第一页数据
this.pageNumber = 0 this.pageNumber = 0
this.loadStatus = 'loading' this.loadStatus = 'loading'
this.getReturnedParts()
},
reachBottom(e) {
if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading'
this.getReturnedParts() this.getReturnedParts()
},
reachBottom(e) {
if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading'
this.getReturnedParts()
}, },
} }
}; };
...@@ -150,21 +149,21 @@ ...@@ -150,21 +149,21 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.ware-house-return { .ware-house-return {
padding: 0 30rpx; padding: 0 30rpx;
height: 100vh; height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.search-view { .search-view {
margin-bottom: 30rpx; margin-bottom: 30rpx;
margin-top: 10rpx; margin-top: 10rpx;
/deep/ .u-search .u-content { /deep/ .u-search .u-content {
padding-left: 40rpx; padding-left: 40rpx;
} }
/deep/ .u-search .u-input { /deep/ .u-search .u-input {
margin: 0 20rpx; margin: 0 20rpx;
} }
/deep/ .u-search .u-icon--right .u-iconfont { /deep/ .u-search .u-icon--right .u-iconfont {
font-size: 36rpx !important; font-size: 36rpx !important;
} }
} }
.tab-view { .tab-view {
...@@ -173,15 +172,15 @@ ...@@ -173,15 +172,15 @@
.load-more-view { .load-more-view {
margin-bottom: 68rpx; margin-bottom: 68rpx;
} }
.loading-view { .loading-view {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 300rpx; margin-top: 300rpx;
position: absolute; position: absolute;
} }
} }
} }
</style> </style>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</view> </view>
<!-- 物料列表 --> <!-- 物料列表 -->
<view class="tab-view"> <view class="tab-view">
<scroll-view scroll-y style="height: 100%;width: 100%;" scroll-anchoring enable-back-to-top @scroll="scroll"> <scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring enable-back-to-top>
<!-- 加载转圈页面 --> <!-- 加载转圈页面 -->
<view class="loading-view" v-if="!loaded"> <view class="loading-view" v-if="!loaded">
<u-loading mode="flower"></u-loading> <u-loading mode="flower"></u-loading>
...@@ -37,9 +37,8 @@ ...@@ -37,9 +37,8 @@
@change="handleChange($event, index)"@numChange="handleNumChange($event, index)" /> @change="handleChange($event, index)"@numChange="handleNumChange($event, index)" />
</view> </view>
<!-- 底部加载状态 --> <!-- 底部加载状态 -->
<view class="load-more-view"> <view class="load-more-view" v-if="partsList.length > 0">
<u-loadmore v-show="partsList.length > 0" status="nomore" bgColor="#F4F5F7"> <u-loadmore status="nomore" bgColor="#F4F5F7"></u-loadmore>
</u-loadmore>
</view> </view>
</template> </template>
</scroll-view> </scroll-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