Commit 52ebf48d authored by Facius's avatar Facius

返件信息

parent 4a214a0d
<template>
<view class="no-order-view" :style="customStyle">
<image class="no-order-image" :src="wudingdanImage"></image>
<text>当前暂无订单</text>
<text>{{text}}</text>
</view>
</template>
......
<template>
<!-- 已申请配件cell -->
<view class="applied-cell" @click="handleClick">
<view class="return-cell" @click="handleClick">
<view class="title-view">
<text class="title-text" :style="{'color': titleColor}">{{title}}</text>
<view>
......@@ -137,7 +137,7 @@
</script>
<style lang="scss" scoped>
.applied-cell {
.return-cell {
padding: 30rpx;
background-color: #FFFFFF;
border-radius: 12rpx;
......
<template>
<!-- 已申请配件cell -->
<view class="applied-cell" @click="handleClick">
<view class="title-view">
<text class="title-text">{{title}}</text>
<view>
<text>返件时间:</text>
<text>{{info.createTime}}</text>
</view>
</view>
<view class="line-view"></view>
<view class="list-content">
<view class="list-item" v-for="(item, index) in info.items" :key="index">
<SpareCell :item="item"/>
</view>
</view>
<view class="line-view"></view>
<view class="info-item">
<view>
<text>返件编号:</text>
<text @longpress="handleLongpress">{{info.number}}</text>
</view>
<text class="copy-view" @click="$u.throttle(handleLongpress, 500)">复制</text>
</view>
<view class="line-view"></view>
<view class="bottom-view">
<view class="total-view">
<text>合计:</text>
<text class="amount-view">{{total}}</text>
<text></text>
</view>
</view>
</view>
</template>
<script>
import SpareCell from "@/components/parts/spareCell.vue"
export default {
components: {
SpareCell
},
props: {
info: {
type: Object,
default() {
return {}
}
}
},
data() {
return {
}
},
computed: {
title() {
return this.info.finished ? '已返件' : '返件中'
},
total() { // 合计
var i = 0
for (var item of this.info.items) {
i += item.quantity
}
return i
},
},
methods: {
handleLongpress() { // 长按复制单号
uni.setClipboardData({
data: this.info.number,
success: function () {
console.log('success');
}
})
}
}
}
</script>
<style lang="scss" scoped>
.applied-cell {
padding: 30rpx;
background-color: #FFFFFF;
border-radius: 12rpx;
margin-bottom: 20rpx;
.title-view{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 26rpx;
color: #333333;
.title-text {
font-size: 36rpx;
font-weight: bold;
}
}
.line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
margin-top: 20rpx;
}
.list-content {
margin-top: 40rpx;
margin-bottom: 40rpx;
.list-item {
margin-bottom: 30rpx;
}
}
.info-item {
margin-top: 24rpx;
margin-bottom: 24rpx;
color: #333333;
font-size: 26rpx;
display: flex;
justify-content: space-between;
align-items: center;
.detail-left-view {}
.copy-view {
color: #2272FF;
padding-left: 30rpx;
}
}
.bottom-view {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 24rpx;
margin-bottom: 4rpx;
.total-view {
font-size: 32rpx;
font-weight: bold;
color: #333333;
.amount-view {
color: #2272FF;
padding-right: 10rpx;
}
}
}
}
</style>
This diff is collapsed.
......@@ -5,43 +5,46 @@
:border-bottom="false" title-bold></u-navbar>
<view class="search-view">
<u-search v-model="keyword" :action-text="searchButtonText" @search="handleClickSearch" @clear="handleClear"
@custom="handleClickButton" placeholder="请输入关键字"
:action-style="actionStyle" placeholder-color="#999999" color="#333333" bg-color="#FFFFFF" height="72">
@custom="handleClickButton" placeholder="请输入关键字" :action-style="actionStyle" placeholder-color="#999999"
color="#333333" bg-color="#FFFFFF" height="72">
</u-search>
</view>
<view class="title-view">
<view>备件列表</view>
<view class="title-right-view">
<view class="bounce-view" v-if="!showBounce" @click="showBounce = true">退件</view>
<u-button v-else :custom-style="buttonStyle" shape="circle" @click="handleClickBounce">退件 ×</u-button>
</view>
</view>
<view class="tab-view">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring
refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
:scroll-top="scrollTop" refresher-background="#F4F5F7" @refresherpulling="triggered = true"
@refresherrefresh="onRefresh" @refresherrestore="onRestore" enable-back-to-top>
<view class="loading-view" v-if="!loaded">
<u-loading mode="flower"></u-loading>
<NoOrder v-if="noParts" imageName="zwdd.png" text="当前暂无备件信息" :customStyle="noPartsCustomStyle" />
<template v-else>
<view class="title-view">
<view>备件列表</view>
<view class="title-right-view">
<view class="bounce-view" v-if="!showBounce" @click="showBounce = true">退件</view>
<u-button v-else :custom-style="buttonStyle" shape="circle" @click="handleClickBounce">退件 ×
</u-button>
</view>
<NoOrder v-else-if="noParts" imageName="zwdd.png" text="当前暂无备件信息" :customStyle="noPartsCustomStyle" />
<template v-else>
<view class="list-item" v-for="(item, index) in partsList" :key="item.id">
<SpareCell :item="item" :noteText="noteText" :showChecked="showBounce"
@change="handleChange(index)" />
</view>
<view class="load-more-view">
<u-loadmore v-show="loaded && partsList.length > 0" status="nomore" bgColor="#F4F5F7">
</u-loadmore>
</view>
<view class="tab-view">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring
refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
:scroll-top="scrollTop" refresher-background="#F4F5F7" @refresherpulling="triggered = true"
@refresherrefresh="onRefresh" @refresherrestore="onRestore" enable-back-to-top>
<view class="loading-view" v-if="!loaded">
<u-loading mode="flower"></u-loading>
</view>
</template>
</scroll-view>
</view>
<view class="bar" v-if="showBounce">
<SubmitBar :partNum="subBarInfo.partNum" :num="subBarInfo.num" :btnStatus="subBarInfo.btnStatus"
submitTxt="退件" :allChecked="subBarInfo.allChecked" :customStyle="customStyle" @select="allSelect"
@submit="handleSubmit" />
</view>
<template v-else>
<view class="list-item" v-for="(item, index) in partsList" :key="item.id">
<SpareCell :item="item" :noteText="noteText" :showChecked="showBounce"
@change="handleChange(index)" />
</view>
<view class="load-more-view">
<u-loadmore v-show="partsList.length > 0" status="nomore" bgColor="#F4F5F7">
</u-loadmore>
</view>
</template>
</scroll-view>
</view>
<view class="bar" v-if="showBounce">
<SubmitBar :partNum="subBarInfo.partNum" :num="subBarInfo.num" :btnStatus="subBarInfo.btnStatus"
submitTxt="退件" :allChecked="subBarInfo.allChecked" :customStyle="customStyle" @select="allSelect"
@submit="handleSubmit" />
</view>
</template>
</view>
</template>
......@@ -64,7 +67,6 @@
loaded: false,
showBounce: false,
keyword: '',
// searched: false,
searchedKeyword: ''
};
},
......@@ -112,9 +114,9 @@
},
customStyle() {
return 'background-color: #F4F5F7;padding: 0;'
},
searchButtonText() {
return this.searchedKeyword == this.keyword && this.keyword ? '取消' : '搜索'
},
searchButtonText() {
return this.searchedKeyword == this.keyword && this.keyword ? '取消' : '搜索'
},
},
onLoad(e) {
......@@ -126,10 +128,10 @@
this.loaded = false
var param = {}
if (this.keyword) {
param.keyword = this.keyword
}
this.searchedKeyword = this.keyword
param.keyword = this.keyword
}
this.searchedKeyword = this.keyword
this.$u.api.reserveList(param).then((res) => {
if (res.code == 200) {
res.data = [{
......@@ -164,7 +166,7 @@
"remark": "dolore quis",
"code": "deserunt cillum incididunt proident",
"stock": "10"
}]
}]
this.partsList = []
let list = res.data || []
for (var item of list) {
......@@ -179,26 +181,23 @@
});
},
handleClickSearch() { // 软键盘搜索
console.log('--------软键盘------', this.keyword)
this.getReserveList()
},
handleClear() { // 清空搜索
console.log('--------清空------', this.keyword)
if (this.searchedKeyword) {
this.getReserveList()
if (this.searchedKeyword) {
this.getReserveList()
}
},
handleClickButton() { // 点了搜索按钮
console.log('--------搜索------', this.keyword)
if (this.searchedKeyword == this.keyword) {
this.keyword = ''
if (this.searchedKeyword == this.keyword) {
this.keyword = ''
}
this.getReserveList()
},
handleClickBounce() {
this.showBounce = false
for (var item of this.partsList) {
item.selected = false
this.showBounce = false
for (var item of this.partsList) {
item.selected = false
}
},
allSelect(value) {
......@@ -225,40 +224,7 @@
flex-direction: column;
.search-view {
// display: flex;
// justify-content: space-between;
// align-items: center;
margin-bottom: 30rpx;
// .search-btn {
// height: 72rpx;
// background-color: #ffffff;
// border-radius: 36rpx;
// color: #999999;
// display: flex;
// align-items: center;
// width: 100%;
// padding-left: 40rpx;
// .search-image {
// width: 36rpx;
// height: 32rpx;
// flex-shrink: 0;
// margin-right: 24rpx;
// }
// .search-btn-placeholder {
// line-height: 36rpx;
// font-weight: 400;
// font-size: 26rpx;
// }
// }
// .search-btn-text {
// line-height: 36rpx;
// font-weight: 400;
// font-size: 32rpx;
// color: #2272FF;
// width: 110rpx;
// text-align: right;
// }
}
.title-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