Commit db22cdc3 authored by Morson's avatar Morson

Merge branch 'dev' of https://git.banshouhui.com/lijundan/self-support into dev

# Conflicts:
#	src/common/api/parts.js
parents fa906c14 01db4852
let partsApiFun = function(vm){ let partsApiFun = function (vm) {
// 接口公共前缀 // 接口公共前缀
const prefix = '/wxh-worker-rest/rest/' const prefix = '/wxh-worker-rest/rest/'
const coverage = '/wxh-worker-rest/rest/coverage/' const coverage = '/wxh-worker-rest/rest/coverage/'
const parts = '/wxh-worker-rest/rest/parts/' const parts = '/wxh-worker-rest/rest/parts/'
const base = '/wxh-worker-rest/rest/base/' const base = '/wxh-worker-rest/rest/base/'
/** /**
* 配件申请单-查询网点地址信息 * 配件申请单-查询网点地址信息
*/ */
...@@ -21,25 +21,31 @@ let partsApiFun = function(vm){ ...@@ -21,25 +21,31 @@ let partsApiFun = function(vm){
* 配件过滤-品牌列表 * 配件过滤-品牌列表
*/ */
let getBrandList = async (params = {}) => await vm.$u.get(base + vm.vuex_token + '/allow/brand/list', params); let getBrandList = async (params = {}) => await vm.$u.get(base + vm.vuex_token + '/allow/brand/list', params);
/** /**
* 查询配件列表 * 查询配件列表
*/ */
let getPartsList = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/parts', params); let getPartsList = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/parts', params);
/** /**
* 配件申请单-创建申请单/使用备件 * 配件申请单-创建申请单/使用备件
*/ */
let applyParts = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/orders', params) let applyParts = async (params = {}) => await vm.$u.post(parts + vm.vuex_token + '/orders', params)
/**
* 查询自己的备件仓
*/
let getMyReserve = async (params = {}) => await vm.$u.get(parts + vm.vuex_token + '/items/reserve', params);
const partsApi = { const partsApi = {
getSiteAddress, getSiteAddress,
updateAddress, updateAddress,
getCategoryList, getCategoryList,
getBrandList, getBrandList,
getPartsList, getPartsList,
applyParts applyParts,
getMyReserve
} }
return partsApi return partsApi
} }
module.exports = { module.exports = {
partsApiFun partsApiFun
} }
\ No newline at end of file
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
case '-1': // 审核未通过 case '-1': // 审核未通过
return '#FA5A49' return '#FA5A49'
case '1': // 已取消 case '1': // 已取消
return '#666666' return '#333333'
default: default:
return '#2272FF' return '#2272FF'
} }
......
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
quantity: 1, quantity: 1,
min: 1, min: 1,
max: 100, max: 100,
image: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png", images: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png",
checked: false, checked: false,
disabled: true disabled: true
}, },
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
quantity: 3, quantity: 3,
min: 1, min: 1,
max: 5, max: 5,
image: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png", images: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png",
checked: false, checked: false,
disabled: true disabled: true
}, },
......
...@@ -88,6 +88,8 @@ ...@@ -88,6 +88,8 @@
font-size: 32rpx; font-size: 32rpx;
color: #333; color: #333;
font-weight: bold; font-weight: bold;
height: 50rpx;
overflow: hidden;
} }
.right-content-desc { .right-content-desc {
font-size: 24rpx; font-size: 24rpx;
...@@ -105,6 +107,7 @@ ...@@ -105,6 +107,7 @@
color: #999; color: #999;
overflow: hidden; overflow: hidden;
flex: 1; flex: 1;
height: 36rpx;
} }
.num { .num {
flex: 1; flex: 1;
......
<template> <template>
<view class="u-flex bottom"> <view class="u-flex bottom" :style="customStyle">
<view class="u-flex bottom-left" v-if="showChecked"> <view class="select-view">
<view class="left-list"><u-checkbox v-model="checked" @change="selectAll" shape="circle" width="30rpx" /></view> <view class="u-flex bottom-left" v-if="showChecked">
<view class="left-list">全选</view> <view class="left-list"><u-checkbox icon-size="30" size="40" v-model="checked" @change="selectAll" shape="circle"/></view>
</view> <view class="left-list">全选</view>
<view class="u-flex bottom-center"> </view>
<view class="center-list">已选择 {{ partNum }} 种配件</view> <view class="u-flex bottom-center">
<view class="center-list">合计 <text class="num"> {{ num }} </text> 件</view> <view class="center-list">已选择 {{ partNum }} 种</view>
</view> <view class="center-list">合计:<text class="num"> {{ num }} </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>
</view> </view>
...@@ -53,6 +55,10 @@ ...@@ -53,6 +55,10 @@
return '确定' return '确定'
} }
} }
},
customStyle: {
type: String,
default: 'background-color: #FFFFFF;padding: 0 30rpx;'
}, },
data() { data() {
return { return {
...@@ -86,28 +92,33 @@ ...@@ -86,28 +92,33 @@
.bottom { .bottom {
width: 100%; width: 100%;
height: 180rpx; height: 180rpx;
background: #fff; // background: #fff;
justify-content: space-between; justify-content: space-between;
.u-flex { .u-flex {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
.select-view {
display: flex;
align-items: center;
}
.bottom-left { .bottom-left {
margin-left: 30rpx; // margin-left: 30rpx;
.left-list { .left-list {
width: 100%; width: 100%;
&:nth-of-type(1) { &:nth-of-type(1) {
padding-left: 10rpx; padding-left: 3rpx;
} }
&:nth-of-type(2) { &:nth-of-type(2) {
padding-top: 20rpx; margin-top: 8rpx;
font-size: 20rpx;
} }
} }
} }
.bottom-center { .bottom-center {
flex: 1; flex: 1;
align-items: flex-start; align-items: flex-start;
margin: 0 20rpx; // margin: 0 20rpx;
.center-list { .center-list {
&:nth-of-type(1) { &:nth-of-type(1) {
color: #666; color: #666;
...@@ -115,18 +126,19 @@ ...@@ -115,18 +126,19 @@
} }
&:nth-of-type(2) { &:nth-of-type(2) {
color: #333; color: #333;
font-size: 28rpx; font-size: 32rpx;
margin-top: 20rpx; margin-top: 8rpx;
font-weight: bold;
.num { .num {
color: #2272FF; color: #2272FF;
padding: 0 10rpx; padding-right: 10rpx;
} }
} }
} }
} }
.bottom-right { .bottom-right {
width: 340rpx; width: 360rpx;
margin-right: 20rpx; // margin-right: 20rpx;
.btn { .btn {
width: 100%; width: 100%;
padding: 30rpx; padding: 30rpx;
......
...@@ -262,6 +262,22 @@ ...@@ -262,6 +262,22 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "warehouse/spare",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "我的备件",
"enablePullDownRefresh": false
}
},
{
"path": "warehouse/return",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "返件信息",
"enablePullDownRefresh": false
}
},
{ {
"path": "warehouse/searchParts", "path": "warehouse/searchParts",
"style": { "style": {
...@@ -276,7 +292,8 @@ ...@@ -276,7 +292,8 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": " ", // 配件单物流 "navigationBarTitleText": " ", // 配件单物流
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7" "navigationBarBackgroundColor": "#F4F5F7",
"disableScroll": true
} }
}, },
{ {
......
...@@ -17,23 +17,32 @@ ...@@ -17,23 +17,32 @@
</view> </view>
</view> </view>
<view v-if="showSuperButton" class="super-button"><u-button@click="handleSuperButton">切换用户</u-button></view> <view v-if="showSuperButton" class="super-button"><u-button@click="handleSuperButton">切换用户</u-button></view>
</view>
<view class="ware-house-view">
<view class="ware-house-title">我的仓库</view>
<view class="ware-house-content">
<view v-for="(item, index) in warehouseItems" :key="index" class="ware-house-content-item" @click="handleClick(item.pathName)">
<image :src="item.icon" class="ware-house-image"></image>
<view>{{item.title}}</view>
</view>
</view>
</view> </view>
<view class="list-view"> <view class="list-view">
<view v-for="(group, ind) in items" :key="ind" class="group-view">
<u-cell-group :border="false"> <u-cell-group :border="false">
<view v-for="(item, index) in items" :key="index"> <view v-for="(item, index) in group" :key="index.pathName">
<u-cell-item :value="item.value" :border-bottom="false" @click="handleClick(item.pathName)"> <u-cell-item :value="item.value" :border-bottom="false" @click="handleClick(item.pathName)">
<image slot="icon" :src="qnFile(item.icon)" :style="item.imageStyle"></image> <image slot="icon" :src="qnFile(item.icon)" :style="item.imageStyle"></image>
<view slot="title" class="item-title">{{item.title}}</view> <view slot="title" class="item-title">{{item.title}}</view>
<view slot="value" class="item-value">{{value}}</view> <view slot="value" class="item-value">{{value}}</view>
</u-cell-item> </u-cell-item>
<view v-if="index == 3" class="line-view"></view>
</view> </view>
</u-cell-group> </u-cell-group>
</view>
</view> </view>
</view> </view>
<u-modal v-model="show" :content="content" show-cancel-button @confirm="logout"></u-modal> <u-modal v-model="show" :content="content" show-cancel-button @confirm="logout"></u-modal>
</view> </view>
</template> </template>
...@@ -67,63 +76,84 @@ ...@@ -67,63 +76,84 @@
}, },
items() { items() {
return [ return [
{ [{
pathName: 'wallet', pathName: 'wallet/index',
title: '我的钱包', title: '我的钱包',
value: '', value: '',
icon: 'qianbao.png', icon: 'qianbao.png',
imageStyle: 'width:34rpx;height:32rpx' imageStyle: 'width:34rpx;height:32rpx'
}, },
{ {
pathName: 'deposit', pathName: 'deposit/index',
title: '配件押金', title: '配件押金',
value: '', value: '',
icon: 'yajin.png', icon: 'yajin.png',
imageStyle: 'width:32rpx;height:32rpx' imageStyle: 'width:32rpx;height:32rpx'
}, },
{ {
pathName: 'contract', pathName: 'contract/index',
title: '我的合同', title: '我的合同',
value: '', value: '',
icon: 'hetong.png', icon: 'hetong.png',
imageStyle: 'width:34rpx;height:32rpx' imageStyle: 'width:34rpx;height:32rpx'
}, },
{ {
pathName: 'cert', pathName: 'cert/index',
title: '我的证件', title: '我的证件',
value: '', value: '',
icon: 'zhengjian.png', icon: 'zhengjian.png',
imageStyle: 'width:36rpx;height:28rpx' imageStyle: 'width:36rpx;height:28rpx'
}, }],[
{ {
pathName: 'address', pathName: 'address/index',
title: '收货地址', title: '收货地址',
value: '', value: '',
icon: 'wddizhi.png', icon: 'wddizhi.png',
imageStyle: 'width:32rpx;height:32rpx' imageStyle: 'width:32rpx;height:32rpx'
}, },
// {
// pathName: 'warehouse',
// title: '我的仓库',
// value: '',
// icon: 'cangku.png',
// imageStyle: 'width:36rpx;height:32rpx'
// },
{ {
pathName: 'warehouse', pathName: 'customer/index',
title: '我的仓库',
value: '',
icon: 'cangku.png',
imageStyle: 'width:36rpx;height:32rpx'
},
{
pathName: 'customer',
title: '联系客服', title: '联系客服',
value: this.serviceTel, value: this.serviceTel,
icon: 'lxkefu.png', icon: 'lxkefu.png',
imageStyle: 'width:32rpx;height:32rpx' imageStyle: 'width:32rpx;height:32rpx'
}, }]
{
pathName: 'about',
title: '版本更新',
value: process.uniEnv.version,
icon: 'version.png',
imageStyle: 'width:32rpx;height:32rpx'
}
] ]
},
warehouseItems() {
return [
{
pathName: 'warehouse/index',
title: '我的配件',
value: '',
icon: process.uniEnv.qn_base_url + 'cangku.png',
},
{
pathName: 'warehouse/spare',
title: '我的备件',
value: '',
icon: process.uniEnv.qn_base_url + 'cangku.png',
},
{
pathName: 'warehouse/return',
title: '返件信息',
value: '',
icon: process.uniEnv.qn_base_url + 'cangku.png',
},
{
pathName: 'warehouse/records',
title: '出入库记录',
value: '',
icon: process.uniEnv.qn_base_url + 'cangku.png',
},
]
}, },
telTip() { telTip() {
return this.mobile || '绑定手机号' return this.mobile || '绑定手机号'
...@@ -162,12 +192,8 @@ ...@@ -162,12 +192,8 @@
}, },
handleClick(path) { handleClick(path) {
if(this.vuex_token) { if(this.vuex_token) {
if (path === 'about') {
app.updateApp(1)
return
}
this.$u.route({ this.$u.route({
url: 'pages/mine/' + path + '/index' url: 'pages/mine/' + path
}) })
} else { } else {
this.$u.route({url: "pages/login/index"}) this.$u.route({url: "pages/login/index"})
...@@ -209,7 +235,7 @@ ...@@ -209,7 +235,7 @@
position: relative; position: relative;
height: 100vh; height: 100vh;
overflow: auto; overflow: auto;
background-color: #FFFFFF; background-color: #F4F5F7;
.header-image { .header-image {
position: absolute; position: absolute;
...@@ -225,12 +251,12 @@ ...@@ -225,12 +251,12 @@
} }
.mine-content { .mine-content {
position: relative; position: relative;
padding: 30rpx;
.header-view { .header-view {
padding: 30rpx 30rpx 80rpx 30rpx;
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 60rpx;
.head-image { .head-image {
width: 144rpx; width: 144rpx;
height: 144rpx; height: 144rpx;
...@@ -279,31 +305,63 @@ ...@@ -279,31 +305,63 @@
.super-button { .super-button {
margin-left: 20rpx; margin-left: 20rpx;
} }
}
.ware-house-view {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 30rpx;
height: 240rpx;
.ware-house-title {
color: #333333;
font-weight: bold;
font-size: 32rpx;
margin-bottom: 12rpx;
}
.ware-house-content {
display: flex;
justify-content: space-around;
align-items: center;
.ware-house-content-item {
color: #333333;
font-size: 26rpx;
text-align: center;
.ware-house-image {
width: 60rpx;
height: 60rpx;
margin-bottom: 12rpx;
}
}
}
} }
.list-view { .list-view {
background-color: #FFFFFF;
border-radius: 32rpx 32rpx 0 0; .group-view {
overflow: hidden; margin-top: 20rpx;
padding-top: 16rpx; background-color: #FFFFFF;
border-radius: 12rpx;
.item-title { overflow: hidden;
font-size: 32rpx; .item-title {
color: #333333; font-size: 32rpx;
margin-left: 16rpx; color: #333333;
line-height: 32rpx; margin-left: 16rpx;
} line-height: 32rpx;
}
.item-value {
font-size: 26rpx; .item-value {
color: #999999; font-size: 26rpx;
} color: #999999;
}
.line-view {
height: 2rpx; .line-view {
background-color: #F4F5F7; height: 2rpx;
margin: 30rpx; background-color: #F4F5F7;
margin: 30rpx;
}
} }
} }
} }
......
<template> <template>
<view class="parts-detail"> <view class="parts-detail">
<u-navbar back-icon-color="#333333" background="#F4F5F7" title="物流信息" titleColor="#333333" :border-bottom="false" title-bold> <u-navbar back-icon-color="#333333" background="#F4F5F7" title="物流信息" titleColor="#333333"
:border-bottom="false" title-bold>
</u-navbar> </u-navbar>
<view class="content-view"> <view class="content-view">
<view class="contacts-view"> <view class="contacts-view">
<view><image class="image-view" :src="imageUrl"></image></view> <view>
<view class="right-view"> <image class="image-view" :src="imageUrl"></image>
<view class="title-view">{{title}}</view> </view>
<view>{{'物流公司:' + info.express.com}}</view> <view class="right-view">
<view class="number-view"> <view class="title-view">{{title}}</view>
<text>{{'物流单号:' + info.express.number}}</text> <view>{{'物流公司:' + info.express.com}}</view>
<text class="copy-view" @click="$u.throttle(handleClick, 500)">复制</text> <view class="number-view">
</view> <text>{{'物流单号:' + info.express.number}}</text>
</view> <text class="copy-view" @click="$u.throttle(handleClick, 500)">复制</text>
</view> </view>
<view class="record-view"> </view>
</view>
<view class="record-view">
<view class="express-record-list">
<view class="dashed-line-view"></view>
<view class="express-list">
<view v-for="(item, index) in logisticsRecords" :key="index" class="order-cell">
<view class="node-view">
<view :class="['node-border-view', {'first': index == 0}]">
<view :class="['node-middle-view', {'first': index == 0}]"></view>
</view>
</view>
<view class="right-view">
<view class="line-view-time">
<text>{{item.datetime}}</text>
</view>
<view class="line-view-context">
<text>{{item.context}}</text>
</view>
</view>
</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
...@@ -26,7 +48,10 @@ ...@@ -26,7 +48,10 @@
export default { export default {
data() { data() {
return { return {
info: {items:[], express: []}, info: {
items: [],
express: []
},
logisticsRecords: [], // 物流 logisticsRecords: [], // 物流
}; };
}, },
...@@ -44,10 +69,10 @@ ...@@ -44,10 +69,10 @@
'-1': '审核未通过', '-1': '审核未通过',
'1': '已取消' '1': '已取消'
} }
}, },
imageUrl() { imageUrl() {
let item = this.info.items[0] || {} let item = this.info.items[0] || {}
return item.images ? item.images.split(',').shift() : this.placeholderImage return item.images ? item.images.split(',').shift() : this.placeholderImage
}, },
titleColor() { titleColor() {
switch (String(this.info.status)) { switch (String(this.info.status)) {
...@@ -60,11 +85,11 @@ ...@@ -60,11 +85,11 @@
} }
}, },
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
}, },
placeholderImage() { placeholderImage() {
...@@ -72,13 +97,12 @@ ...@@ -72,13 +97,12 @@
}, },
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('配件单物流信息') getApp().trackPage('配件单物流信息')
var pages = getCurrentPages(); var pages = getCurrentPages();
if (pages.length >= 2) { if (pages.length >= 2) {
var page = pages[pages.length - 2]; var page = pages[pages.length - 2];
console.log('-------page.info------', page.info) this.info = page.info
this.info = page.info }
}
this.getLogistics() this.getLogistics()
}, },
methods: { methods: {
...@@ -139,8 +163,8 @@ ...@@ -139,8 +163,8 @@
} }
} }
if (res.code == 200) { if (res.code == 200) {
if (res.data && res.data.records) { if (res.data && res.data.expressInfo && res.data.expressInfo.records) {
this.logisticsRecords = res.data.records this.logisticsRecords = res.data.expressInfo.records
} }
} else { } else {
console.log(res.message) console.log(res.message)
...@@ -148,13 +172,13 @@ ...@@ -148,13 +172,13 @@
}); });
}, },
handleClick() { handleClick() {
uni.setClipboardData({ uni.setClipboardData({
data: this.info.orderNumber, data: this.info.orderNumber,
success: function() { success: function() {
console.log('success'); console.log('success');
} }
}); });
} }
} }
}; };
...@@ -168,50 +192,133 @@ ...@@ -168,50 +192,133 @@
background-color: #F4F5F7; background-color: #F4F5F7;
height: 100vh; height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.content-view { .content-view {
padding: 30rpx; padding: 30rpx;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
.contacts-view { .contacts-view {
padding: 30rpx; padding: 30rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 12rpx; border-radius: 12rpx;
.image-view {
width: 120rpx; .image-view {
height: 120rpx; width: 120rpx;
border-radius: 12rpx; height: 120rpx;
} border-radius: 12rpx;
.right-view { }
font-size: 26rpx;
color: #333333; .right-view {
padding-left: 30rpx; font-size: 26rpx;
width: 100%; color: #333333;
.title-view { padding-left: 30rpx;
font-weight: bold; width: 100%;
.title-view {
font-weight: bold;
font-size: 32rpx; font-size: 32rpx;
} margin-bottom: 12rpx;
.number-view { }
display: flex;
justify-content: space-between; .number-view {
align-items: center; display: flex;
.copy-view { justify-content: space-between;
color: #2272FF; align-items: center;
padding-left: 30rpx; margin-top: 12rpx;
} .copy-view {
} color: #2272FF;
} padding-left: 30rpx;
flex-shrink: 0;
}
}
}
} }
.record-view {
background-color: #FFFFFF; .record-view {
border-radius: 12rpx; background-color: #FFFFFF;
border-radius: 12rpx;
padding: 30rpx 30rpx 0 30rpx;
position: relative;
display: flex;
justify-content: space-between;
.express-record-list {
position: relative;
.dashed-line-view {
position: absolute;
width: 2rpx;
border-left: 1px dashed #999999;
height: calc(100% - 64rpx);
top: 14rpx;
left: 11rpx;
}
.express-list {
width: 100%;
.order-cell {
margin-bottom: 50rpx;
display: flex;
.node-view {
margin-right: 18rpx;
flex-shrink: 0;
margin-top: 8rpx;
z-index: 1;
.node-border-view {
border: 2rpx solid #999999;
border-radius: 11rpx;
width: 22rpx;
height: 22rpx;
padding: 5rpx;
background-color: #FFFFFF;
&.first {
border: 2rpx solid #2272FF;
}
.node-middle-view {
width: 10rpx;
height: 10rpx;
background-color: #999999;
border-radius: 6rpx;
&.first {
background-color: #2272FF;
}
}
}
}
.right-view {
width: 100%;
.line-view-time {
font-size: 28rpx;
font-weight: bold;
color: #333333;
margin-bottom: 20rpx;
}
.line-view-context {
font-size: 26rpx;
color: #666666;
}
}
}
}
}
} }
} }
......
<template> <template>
<!-- 我的配件 -->
<view class="ware-house"> <view class="ware-house">
<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="tools-box"> <!-- <view class="tools-box">
<view class="search-sub"> <view class="search-sub">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<view class="detail-info-view"> <view class="detail-info-view">
<view v-for="(value, key) in detailKey" :key="key" class="info-item"> <view v-for="(value, key) in detailKey" :key="key" class="info-item">
<view class="detail-left-view"> <view class="detail-left-view">
<text>{{ value }}:</text> <text>{{ value }}</text>
<text @longpress="handleLongpress(key, detail[key] )">{{ detail[key] }}</text> <text @longpress="handleLongpress(key, detail[key] )">{{ detail[key] }}</text>
</view> </view>
<text class="copy-view" v-if="key == 'orderNumber'" @click="$u.throttle(handleClickCopy, 500)"> <text class="copy-view" v-if="key == 'orderNumber'" @click="$u.throttle(handleClickCopy, 500)">
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<text class="amount-view">{{total}}</text> <text class="amount-view">{{total}}</text>
<text>件</text> <text>件</text>
</view> </view>
<u-button v-if="buttonText" :custom-style="customStyle" shape="circle" @click="handleClick" type="primary"> <u-button :custom-style="customStyle" shape="circle" @click="handleClick" type="primary">
{{buttonText}} {{buttonText}}
</u-button> </u-button>
</view> </view>
...@@ -131,9 +131,9 @@ ...@@ -131,9 +131,9 @@
}, },
detailKey() { // 详情 detailKey() { // 详情
return { return {
'orderNumber': '申请单号', 'orderNumber': '申请单号:',
'createTime': '申请时间', 'createTime': '申请时间:',
'deliveryTime': '发货时间', 'deliveryTime': '发货时间:',
} }
} }
}, },
...@@ -207,7 +207,8 @@ ...@@ -207,7 +207,8 @@
.express-view { .express-view {
color: #2272FF; color: #2272FF;
font-size: 26rpx; font-size: 26rpx;
margin-bottom: 6rpx;
} }
} }
...@@ -279,7 +280,7 @@ ...@@ -279,7 +280,7 @@
.left-view { .left-view {
display: flex; display: flex;
align-items: center; align-items: flex-start;
.image-view { .image-view {
width: 120rpx; width: 120rpx;
......
<template>
<!-- 返件信息 -->
<view class="ware-house-return">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="返件信息" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar>
<view class="search-view">
<view class="search-btn" @click="handleClickSearch">
<image class="search-image" mode="widthFix" :src="sousuoImage"></image>
<text class="search-btn-placeholder">请输入关键字</text>
</view>
<text class="search-btn-text">搜索</text>
</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>
<NoOrder v-else-if="noParts" imageName="zwdd.png" text="当前暂无配件信息" :customStyle="noPartsCustomStyle" />
<template v-else>
<view v-for="(item, index) in partsList" :key="item.id">
<AppliedCell @operate="handleOperate" :info="item" @action="handleClickCell"></AppliedCell>
</view>
<view class="load-more-view">
<u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 2" :status="loadStatus"
bgColor="#F4F5F7"></u-loadmore>
</view>
</template>
</scroll-view>
</view>
</view>
</template>
<script>
import AppliedCell from "@/components/parts/appliedPartsCell.vue"
import NoOrder from "@/components/order/noOrder.vue"
export default {
components: {
AppliedCell,
NoOrder
},
data() {
return {
pageNumber: 0,
pageSize: 100,
partsList: [],
loadStatus: 'loading',
loaded: false,
};
},
computed: {
sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png'
},
noParts() {
return this.partsList.length == 0 && this.loaded
},
noPartsCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7'
},
},
onLoad(e) {
getApp().trackPage('我的配件页')
this.reloadPartsList()
},
methods: {
getReturnedParts() { // 返件列表
this.pageNumber += 1
this.loaded = false
var param = {
'pageSize': 20,
'pageNumbr': 1,
'items': true,
'type': 'new'
}
this.$u.api.returnedParts(param).then((res) => {
if (res.code == 200) {
if (this.pageNumber == 1) {
this.partsList = []
}
res.data = [{"id":9406509.806407556,"type":86614521.01432693,"orderNumber":"RQ9543573175802","uid":67994626.298127,"workerId":69452943.60857615,"siteId":270403.14672003686,"status":15,"totalPriceApply":96899360.2165232,"totalPriceOuter":35919580.812509984,"totalPriceWarranty":-83602139.37454514,"totalPriceActual":-71939604.96854639,"warehouseId":61923414.728333235,"applyRemark":"tempor esse adipisicing nulla","deliverRemark":"enim","createTime":"cupidatat in Excepteur esse anim","updateTime":"dolore cillum","items":[{"id":88259111.29600757,"orderId":48226509.228051245,"name":"空开盒","partId":-52087023.09823719,"status":15,"quantity":2,"priceApply":-74553732.16561832,"priceActual":-52938715.5216837,"returnType":71273082.1392237,"useCount":68961949.10468733,"createTime":"ut minim laboris ex ea","updateTime":"culpa ea nulla adipisicing","returnId":-73960153.99926767, "images": "/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg"},{"id":-3524944.017209992,"orderId":34533058.60869488,"name":"电缆","partId":78320657.17744848,"status":15,"quantity":6,"priceApply":72739542.49244872,"priceActual":5169889.19776167,"returnType":-92361482.60375243,"useCount":59522052.97427672,"createTime":"ut velit adipisicing incididunt","updateTime":"pariatur sed proident","returnId":-96764909.17950238,"images": "/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg"}],"images":"/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg","statusText":"待审核","workOrderId":-12573027.93228963,"workOrderNumber":"OR20150327000003","measures":"est","express":{"orderId":1804452.0561671257,"status":-1,"name":"机顶盒","phoneNumber":"minim Ut nisi","areaCode":42437809.509774685,"address":"magna","createTime":"mollit tempor cillum","deliveryTime":"consequat et labore dolore","updateTime":"nostrud","remark":"eiusmod mollit ea aute","com":"sint nisi anim elit dolor","number":"consectetur ex"},"productModel":"incididunt magna velit Excepteur laboris","productBarcode":"esse","supplierId":53499096.003008485,"brandName":"长虹(CHANGHONG)","productId":-68709997.40881962,"categoryName":"电冰箱"},{"id":21491164.69065389,"type":-99940494.04686938,"orderNumber":"RE9878766666","uid":-86210053.82862727,"workerId":47505594.97869697,"siteId":-3766937.9397049993,"status":-1,"totalPriceApply":78049843.31156719,"totalPriceOuter":-97305746.39303829,"totalPriceWarranty":-93872258.5442259,"totalPriceActual":54629844.58685568,"warehouseId":72893467.15425757,"applyRemark":"ullamco cillum commodo tempor","deliverRemark":"labore dolor Ut ex id","createTime":"laborum enim minim sint","updateTime":"tempor pariatur","items":[{"id":22876807.093349114,"orderId":-73328349.75448325,"name":"proident culpa","partId":-57956331.85626335,"status":-61540349.085944615,"quantity":88196350.70342317,"priceApply":-49775657.860448994,"priceActual":-25006069.17107247,"returnType":84771113.8737934,"useCount":86264998.81449816,"createTime":"pariatur commodo esse nisi Ut","updateTime":"officia laboris cupidatat","returnId":73065823.78881967},{"id":-51040560.904031195,"orderId":-28945683.292889908,"name":"cupidatat veniam reprehenderit velit ea","partId":38434800.50565642,"status":43614158.136024624,"quantity":9111630.336844191,"priceApply":38764169.330946624,"priceActual":-1931327.0985768437,"returnType":-93067293.47853354,"useCount":90333545.98417392,"createTime":"nisi","updateTime":"cillum dolore sint","returnId":91168418.0917764},{"id":45557257.39867419,"orderId":1407586.8636095077,"name":"ad labore tempor","partId":-99019059.82541245,"status":8199757.844844416,"quantity":49577898.758369386,"priceApply":78393740.80746442,"priceActual":-19161016.249845147,"returnType":-99616253.70173919,"useCount":-91155682.11473106,"createTime":"quis id sunt magna proident","updateTime":"consequat irure","returnId":69728822.52361763},{"id":52490483.55701485,"orderId":22205466.1845994,"name":"minim","partId":99353322.81353238,"status":74090404.86914167,"quantity":92588636.85998356,"priceApply":21638286.200525463,"priceActual":42168758.11864549,"returnType":2228380.1288566887,"useCount":-56271233.94790425,"createTime":"ullamco","updateTime":"sit Duis id proident","returnId":-48202137.79856801},{"id":-17082858.02511455,"orderId":-74415557.20143555,"name":"eu mollit","partId":-29774044.667875186,"status":73843352.9406685,"quantity":-12878510.704664588,"priceApply":47246503.69669163,"priceActual":-50399277.40573487,"returnType":80989912.69142082,"useCount":26525737.12704797,"createTime":"id","updateTime":"Duis","returnId":18003864.839698642}],"images":"/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg","statusText":"待审核","productId":23292895.61379446,"categoryName":"电冰箱","productModel":"pariatur est laborum Lorem velit","supplierId":5143732.578579828,"workOrderId":75720200.59443054,"measures":"pariatur nisi","productBarcode":"fugiat","brandName":"长虹(CHANGHONG)","workOrderNumber":"OR20150327000003","express":{"orderId":-45628847.934746996,"status":84421057.49708548,"name":"anim","phoneNumber":"laborum anim elit et ex","areaCode":-8920144.598569289,"address":"ut fugiat consequat pariatur incididunt","createTime":"incididunt in","deliveryTime":"enim consequat do incididunt adipisicing","updateTime":"voluptate magna Ut elit sint","number":"Excepteur sunt pariatur velit est","com":"ea sint irure eiusmod","remark":"aliqua quis tempor"}},{"id":78424322.41282636,"type":33783320.35653822,"orderNumber":"esse do amet nulla","uid":96825133.44702333,"workerId":-20514660.459787086,"siteId":-96725068.14741592,"status":1,"totalPriceApply":12907471.845122173,"totalPriceOuter":83153762.12794018,"totalPriceWarranty":-45816944.25450489,"totalPriceActual":46263733.25401527,"warehouseId":-80245498.07111172,"applyRemark":"irure laborum","deliverRemark":"non in nulla eiusmod consectetur","createTime":"enim laboris","updateTime":"non Excepteur incididunt magna aliquip","items":[{"id":43122261.98756099,"orderId":89891559.09495953,"name":"aute tempor sed","partId":-33112044.289685547,"status":-90355790.51323123,"quantity":99573793.60419351,"priceApply":-1347292.11380589,"priceActual":60305230.40028921,"returnType":-34640097.10314855,"useCount":79567567.223061,"createTime":"cillum eu deserunt","updateTime":"exercitation nisi in","returnId":-31561799.157562435}],"images":"/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg","statusText":"待审核","workOrderNumber":"OR20150327000003","express":{"orderId":-77965448.40290305,"status":-48505936.17972718,"name":"qui Duis","phoneNumber":"anim occaecat sit commodo","areaCode":-32566304.761578918,"address":"proident Excepteur","createTime":"non laboris dolor et","deliveryTime":"dolore veniam Duis","updateTime":"nulla esse","number":"sint ut et esse","com":"irure laboris","remark":"dolor Lorem laboris dolor"},"productBarcode":"cillum nulla Ut ipsum","productId":-47980724.91529095,"measures":"exercitation","brandName":"长虹(CHANGHONG)","supplierId":-21118419.445017934,"productModel":"incididunt irure","workOrderId":23532670.725171506,"categoryName":"电冰箱"},{"id":-27016749.524627715,"type":98311830.96038702,"orderNumber":"Excepteur exercitation voluptate","uid":-23955900.388702527,"workerId":12348320.263107345,"siteId":85445481.861619,"status":-85639031.40044658,"totalPriceApply":59578811.39297968,"totalPriceOuter":63020136.54167214,"totalPriceWarranty":43624244.99155545,"totalPriceActual":66909001.40717006,"warehouseId":61666308.50697875,"applyRemark":"reprehenderit dolor consectetur","deliverRemark":"voluptate aute elit Excepteur","createTime":"dolore veniam Duis","updateTime":"labore proident ut deserunt irure","items":[{"id":29537776.228774786,"orderId":67503467.09976402,"name":"minim nulla nisi ex eu","partId":-21949243.355626136,"status":93701973.31152403,"quantity":-5584003.629620329,"priceApply":7135128.281559229,"priceActual":85248204.81612098,"returnType":12998787.696959198,"useCount":-68055928.52868809,"createTime":"laboris voluptate in consequat dolor","updateTime":"culpa in","returnId":-20348547.63497989},{"id":39742322.49149105,"orderId":96562506.70698965,"name":"dolore eiusmod occaecat","partId":-26810768.572022334,"status":2796631.830863744,"quantity":-26922446.21481517,"priceApply":-55179205.75027007,"priceActual":5697379.518900096,"returnType":53261341.24092224,"useCount":74342986.36835992,"createTime":"ipsum laborum","updateTime":"dolore","returnId":-21860322.65894431},{"id":-17470619.832603917,"orderId":48112878.69515741,"name":"commodo","partId":27845586.202810198,"status":83884256.5329633,"quantity":69335236.06709576,"priceApply":-84246321.52978861,"priceActual":28965031.536926314,"returnType":-550131.0979412645,"useCount":99968478.51870897,"createTime":"pariatur qui cillum Duis","updateTime":"proident aliqua sunt","returnId":14952441.495038033},{"id":34995646.945470065,"orderId":-39293942.692088366,"name":"sunt","partId":57973905.82733452,"status":66859878.30531177,"quantity":-72406647.4199554,"priceApply":-10822358.045907527,"priceActual":26050607.973160654,"returnType":45059697.69330442,"useCount":41999647.11947328,"createTime":"proident in mollit in","updateTime":"reprehenderit magna amet","returnId":-86293781.49458757},{"id":96571724.33663553,"orderId":-16255981.89165847,"name":"minim ipsum ullamco culpa","partId":33297414.986852616,"status":35470971.70208612,"quantity":-47109346.81945864,"priceApply":-72173057.59690742,"priceActual":-94334669.98701036,"returnType":-47114863.55247505,"useCount":92358631.7287406,"createTime":"consectetur reprehenderit minim Excepteur","updateTime":"ut aute anim sed","returnId":92143490.11591995}],"images":"/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg","statusText":"待审核","productBarcode":"laborum cillum adipisicing ad velit","categoryName":"电冰箱","workOrderId":12532424.255793735,"workOrderNumber":"OR20150327000003","brandName":"长虹(CHANGHONG)","express":{"orderId":-47061242.5943119,"status":-71113301.69277315,"name":"sit in","phoneNumber":"voluptate dolor commodo","areaCode":3163523.565223247,"address":"sed consectetur aliqua","createTime":"occaecat fugiat in mollit","deliveryTime":"consectetur anim","updateTime":"velit non enim ut","com":"qui sint cillum","remark":"sed nostrud cillum","number":"veniam nulla"},"supplierId":659667.8267708272,"productId":87457975.53702831,"productModel":"ex","measures":"do in non"},{"id":79910321.25893903,"type":-92755715.85938272,"orderNumber":"dolore","uid":32045129.492245644,"workerId":-87225497.55755508,"siteId":929206.9191809446,"status":-49628754.46400306,"totalPriceApply":-86759265.47973964,"totalPriceOuter":77774648.6038025,"totalPriceWarranty":-43192184.70357793,"totalPriceActual":63259397.26451972,"warehouseId":-51540398.5483279,"applyRemark":"ut","deliverRemark":"est labore dolor","createTime":"consectetur","updateTime":"ut velit tempor irure mollit","items":[{"id":-59145028.86317692,"orderId":-11320686.899104223,"name":"enim","partId":49736274.59968069,"status":95250295.35558042,"quantity":-81208607.06551526,"priceApply":-8044619.175376594,"priceActual":-48277760.54597996,"returnType":64159297.29585245,"useCount":84371931.03454325,"createTime":"esse ea dolor anim nulla","updateTime":"laborum reprehenderit sit veniam","returnId":24299761.634605184}],"images":"/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg","statusText":"待审核","productModel":"ut sint dolor reprehenderit eu","brandName":"长虹(CHANGHONG)","productBarcode":"reprehenderit laboris Lorem tempor","measures":"irure elit pariatur","supplierId":-36938327.731029876,"workOrderId":78526155.84958395,"express":{"orderId":-49350095.5799381,"status":29255996.85214384,"name":"irure labore","phoneNumber":"dolor mollit pariatur consectetur","areaCode":43876681.307484895,"address":"ipsum enim dolor nostrud proident","createTime":"in pariatur eiusmod","deliveryTime":"ea","updateTime":"aute","remark":"ut id magna","number":"eu Ut","com":"dolor culpa non Ut"},"productId":-58537035.058075525,"workOrderNumber":"OR20150327000003","categoryName":"电冰箱"}]
let list = res.data || []
this.partsList.push(...list)
this.loadStatus = list.length < this.pageSize ? 'nomore' : 'loadmore'
} else {
console.log(res.message)
}
this.loaded = true
});
},
handleOperate(info) {
// 调接口
// 修改info的status
// 刷新页面
},
handleClickCell(info) {
var pages = getCurrentPages();
if (pages.length >= 1) {
var page = pages[pages.length - 1];
page.info = info
}
uni.navigateTo({
url: 'pages/mine/warehouse/partsDetail'
})
},
handleClickSearch() {
},
onRestore() {
this.triggered = 'restore'; // 需要重置
},
reloadPartsList() { // 第一页数据
this.pageNumber = 0
this.loadStatus = 'loading'
this.getReturnedParts()
},
reachBottom(e) {
if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading'
this.getReturnedParts()
},
}
};
</script>
<style lang="scss" scoped>
.ware-house-return {
padding: 0 30rpx;
height: 100vh;
display: flex;
flex-direction: column;
.search-view {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
.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;
}
}
.tab-view {
height: 100%;
overflow: auto;
.load-more-view {
margin-bottom: 20rpx;
}
.loading-view {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 300rpx;
position: absolute;
}
}
}
</style>
<template>
<!-- 我的备件 -->
<view class="ware-house-spare">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="我的备件" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar>
<view class="search-view">
<view class="search-btn" @click="handleClickSearch">
<image class="search-image" mode="widthFix" :src="sousuoImage"></image>
<text class="search-btn-placeholder">请输入关键字</text>
</view>
<text class="search-btn-text">搜索</text>
</view>
<view class="title-view">
<view>备件列表</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 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>
<NoOrder v-else-if="noParts" imageName="zwdd.png" text="当前暂无配件信息" :customStyle="noPartsCustomStyle" />
<template v-else>
<view v-for="(item, index) in partsList" :key="item.id">
<AppliedCell @operate="handleOperate" :info="item" @action="handleClickCell"></AppliedCell>
</view>
<view class="load-more-view">
<u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 2" :status="loadStatus"
bgColor="#F4F5F7"></u-loadmore>
</view>
</template>
</scroll-view>
</view>
<view class="bar" v-if="showBounce">
<SubmitBar
:partNum="partNum"
:num="total"
:btnStatus="partNum > 0"
submitTxt="退件"
:allChecked="allChecked"
:background="background"
:customStyle="customStyle"
@select="allSelect"
@submit="handleSubmit"
/>
</view>
</view>
</template>
<script>
import AppliedCell from "@/components/parts/appliedPartsCell.vue"
import NoOrder from "@/components/order/noOrder.vue"
import SubmitBar from "@/components/submit-bar/index"
export default {
components: {
AppliedCell,
NoOrder,
SubmitBar
},
data() {
return {
pageNumber: 0,
pageSize: 100,
partsList: [],
loadStatus: 'loading',
loaded: false,
showBounce: false
};
},
computed: {
sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png'
},
noParts() {
return this.partsList.length == 0 && this.loaded
},
noPartsCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7'
},
buttonStyle() {
return {
marginRight: '10rpx',
width: '100rpx',
height: '52rpx',
background: '#FFFFFF',
color: '#2272FF',
fontSize: '24rpx',
fontWeight: '400',
lineHeight: '52rpx'
}
},
partNum() {
return this.partsList.filter((item) => {
return item.selected == true
}).length
},
total() { // 合计
var i = 0
for (var item of this.partsList) {
i += item.quantity
}
return i
},
customStyle() {
return 'background-color: #F4F5F7;padding: 0;'
}
},
onLoad(e) {
getApp().trackPage('我的备件页')
this.reloadPartsList()
},
methods: {
getReserveList() { // 备件列表
this.pageNumber += 1
this.loaded = false
var param = {
'pageSize': 20,
'pageNumbr': 1,
}
this.$u.api.reserveList().then((res) => {
if (res.code == 200) {
if (this.pageNumber == 1) {
this.partsList = []
}
res.data = [{"id":9406509.806407556,"type":86614521.01432693,"orderNumber":"RQ9543573175802","uid":67994626.298127,"workerId":69452943.60857615,"siteId":270403.14672003686,"status":15,"totalPriceApply":96899360.2165232,"totalPriceOuter":35919580.812509984,"totalPriceWarranty":-83602139.37454514,"totalPriceActual":-71939604.96854639,"warehouseId":61923414.728333235,"applyRemark":"tempor esse adipisicing nulla","deliverRemark":"enim","createTime":"cupidatat in Excepteur esse anim","updateTime":"dolore cillum","items":[{"id":88259111.29600757,"orderId":48226509.228051245,"name":"空开盒","partId":-52087023.09823719,"status":15,"quantity":2,"priceApply":-74553732.16561832,"priceActual":-52938715.5216837,"returnType":71273082.1392237,"useCount":68961949.10468733,"createTime":"ut minim laboris ex ea","updateTime":"culpa ea nulla adipisicing","returnId":-73960153.99926767, "images": "/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg"},{"id":-3524944.017209992,"orderId":34533058.60869488,"name":"电缆","partId":78320657.17744848,"status":15,"quantity":6,"priceApply":72739542.49244872,"priceActual":5169889.19776167,"returnType":-92361482.60375243,"useCount":59522052.97427672,"createTime":"ut velit adipisicing incididunt","updateTime":"pariatur sed proident","returnId":-96764909.17950238,"images": "/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg"}],"images":"/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg","statusText":"待审核","workOrderId":-12573027.93228963,"workOrderNumber":"OR20150327000003","measures":"est","express":{"orderId":1804452.0561671257,"status":-1,"name":"机顶盒","phoneNumber":"minim Ut nisi","areaCode":42437809.509774685,"address":"magna","createTime":"mollit tempor cillum","deliveryTime":"consequat et labore dolore","updateTime":"nostrud","remark":"eiusmod mollit ea aute","com":"sint nisi anim elit dolor","number":"consectetur ex"},"productModel":"incididunt magna velit Excepteur laboris","productBarcode":"esse","supplierId":53499096.003008485,"brandName":"长虹(CHANGHONG)","productId":-68709997.40881962,"categoryName":"电冰箱"},{"id":21491164.69065389,"type":-99940494.04686938,"orderNumber":"RE9878766666","uid":-86210053.82862727,"workerId":47505594.97869697,"siteId":-3766937.9397049993,"status":-1,"totalPriceApply":78049843.31156719,"totalPriceOuter":-97305746.39303829,"totalPriceWarranty":-93872258.5442259,"totalPriceActual":54629844.58685568,"warehouseId":72893467.15425757,"applyRemark":"ullamco cillum commodo tempor","deliverRemark":"labore dolor Ut ex id","createTime":"laborum enim minim sint","updateTime":"tempor pariatur","items":[{"id":22876807.093349114,"orderId":-73328349.75448325,"name":"proident culpa","partId":-57956331.85626335,"status":-61540349.085944615,"quantity":88196350.70342317,"priceApply":-49775657.860448994,"priceActual":-25006069.17107247,"returnType":84771113.8737934,"useCount":86264998.81449816,"createTime":"pariatur commodo esse nisi Ut","updateTime":"officia laboris cupidatat","returnId":73065823.78881967},{"id":-51040560.904031195,"orderId":-28945683.292889908,"name":"cupidatat veniam reprehenderit velit ea","partId":38434800.50565642,"status":43614158.136024624,"quantity":9111630.336844191,"priceApply":38764169.330946624,"priceActual":-1931327.0985768437,"returnType":-93067293.47853354,"useCount":90333545.98417392,"createTime":"nisi","updateTime":"cillum dolore sint","returnId":91168418.0917764},{"id":45557257.39867419,"orderId":1407586.8636095077,"name":"ad labore tempor","partId":-99019059.82541245,"status":8199757.844844416,"quantity":49577898.758369386,"priceApply":78393740.80746442,"priceActual":-19161016.249845147,"returnType":-99616253.70173919,"useCount":-91155682.11473106,"createTime":"quis id sunt magna proident","updateTime":"consequat irure","returnId":69728822.52361763},{"id":52490483.55701485,"orderId":22205466.1845994,"name":"minim","partId":99353322.81353238,"status":74090404.86914167,"quantity":92588636.85998356,"priceApply":21638286.200525463,"priceActual":42168758.11864549,"returnType":2228380.1288566887,"useCount":-56271233.94790425,"createTime":"ullamco","updateTime":"sit Duis id proident","returnId":-48202137.79856801},{"id":-17082858.02511455,"orderId":-74415557.20143555,"name":"eu mollit","partId":-29774044.667875186,"status":73843352.9406685,"quantity":-12878510.704664588,"priceApply":47246503.69669163,"priceActual":-50399277.40573487,"returnType":80989912.69142082,"useCount":26525737.12704797,"createTime":"id","updateTime":"Duis","returnId":18003864.839698642}],"images":"/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg","statusText":"待审核","productId":23292895.61379446,"categoryName":"电冰箱","productModel":"pariatur est laborum Lorem velit","supplierId":5143732.578579828,"workOrderId":75720200.59443054,"measures":"pariatur nisi","productBarcode":"fugiat","brandName":"长虹(CHANGHONG)","workOrderNumber":"OR20150327000003","express":{"orderId":-45628847.934746996,"status":84421057.49708548,"name":"anim","phoneNumber":"laborum anim elit et ex","areaCode":-8920144.598569289,"address":"ut fugiat consequat pariatur incididunt","createTime":"incididunt in","deliveryTime":"enim consequat do incididunt adipisicing","updateTime":"voluptate magna Ut elit sint","number":"Excepteur sunt pariatur velit est","com":"ea sint irure eiusmod","remark":"aliqua quis tempor"}},{"id":78424322.41282636,"type":33783320.35653822,"orderNumber":"esse do amet nulla","uid":96825133.44702333,"workerId":-20514660.459787086,"siteId":-96725068.14741592,"status":1,"totalPriceApply":12907471.845122173,"totalPriceOuter":83153762.12794018,"totalPriceWarranty":-45816944.25450489,"totalPriceActual":46263733.25401527,"warehouseId":-80245498.07111172,"applyRemark":"irure laborum","deliverRemark":"non in nulla eiusmod consectetur","createTime":"enim laboris","updateTime":"non Excepteur incididunt magna aliquip","items":[{"id":43122261.98756099,"orderId":89891559.09495953,"name":"aute tempor sed","partId":-33112044.289685547,"status":-90355790.51323123,"quantity":99573793.60419351,"priceApply":-1347292.11380589,"priceActual":60305230.40028921,"returnType":-34640097.10314855,"useCount":79567567.223061,"createTime":"cillum eu deserunt","updateTime":"exercitation nisi in","returnId":-31561799.157562435}],"images":"/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg","statusText":"待审核","workOrderNumber":"OR20150327000003","express":{"orderId":-77965448.40290305,"status":-48505936.17972718,"name":"qui Duis","phoneNumber":"anim occaecat sit commodo","areaCode":-32566304.761578918,"address":"proident Excepteur","createTime":"non laboris dolor et","deliveryTime":"dolore veniam Duis","updateTime":"nulla esse","number":"sint ut et esse","com":"irure laboris","remark":"dolor Lorem laboris dolor"},"productBarcode":"cillum nulla Ut ipsum","productId":-47980724.91529095,"measures":"exercitation","brandName":"长虹(CHANGHONG)","supplierId":-21118419.445017934,"productModel":"incididunt irure","workOrderId":23532670.725171506,"categoryName":"电冰箱"},{"id":-27016749.524627715,"type":98311830.96038702,"orderNumber":"Excepteur exercitation voluptate","uid":-23955900.388702527,"workerId":12348320.263107345,"siteId":85445481.861619,"status":-85639031.40044658,"totalPriceApply":59578811.39297968,"totalPriceOuter":63020136.54167214,"totalPriceWarranty":43624244.99155545,"totalPriceActual":66909001.40717006,"warehouseId":61666308.50697875,"applyRemark":"reprehenderit dolor consectetur","deliverRemark":"voluptate aute elit Excepteur","createTime":"dolore veniam Duis","updateTime":"labore proident ut deserunt irure","items":[{"id":29537776.228774786,"orderId":67503467.09976402,"name":"minim nulla nisi ex eu","partId":-21949243.355626136,"status":93701973.31152403,"quantity":-5584003.629620329,"priceApply":7135128.281559229,"priceActual":85248204.81612098,"returnType":12998787.696959198,"useCount":-68055928.52868809,"createTime":"laboris voluptate in consequat dolor","updateTime":"culpa in","returnId":-20348547.63497989},{"id":39742322.49149105,"orderId":96562506.70698965,"name":"dolore eiusmod occaecat","partId":-26810768.572022334,"status":2796631.830863744,"quantity":-26922446.21481517,"priceApply":-55179205.75027007,"priceActual":5697379.518900096,"returnType":53261341.24092224,"useCount":74342986.36835992,"createTime":"ipsum laborum","updateTime":"dolore","returnId":-21860322.65894431},{"id":-17470619.832603917,"orderId":48112878.69515741,"name":"commodo","partId":27845586.202810198,"status":83884256.5329633,"quantity":69335236.06709576,"priceApply":-84246321.52978861,"priceActual":28965031.536926314,"returnType":-550131.0979412645,"useCount":99968478.51870897,"createTime":"pariatur qui cillum Duis","updateTime":"proident aliqua sunt","returnId":14952441.495038033},{"id":34995646.945470065,"orderId":-39293942.692088366,"name":"sunt","partId":57973905.82733452,"status":66859878.30531177,"quantity":-72406647.4199554,"priceApply":-10822358.045907527,"priceActual":26050607.973160654,"returnType":45059697.69330442,"useCount":41999647.11947328,"createTime":"proident in mollit in","updateTime":"reprehenderit magna amet","returnId":-86293781.49458757},{"id":96571724.33663553,"orderId":-16255981.89165847,"name":"minim ipsum ullamco culpa","partId":33297414.986852616,"status":35470971.70208612,"quantity":-47109346.81945864,"priceApply":-72173057.59690742,"priceActual":-94334669.98701036,"returnType":-47114863.55247505,"useCount":92358631.7287406,"createTime":"consectetur reprehenderit minim Excepteur","updateTime":"ut aute anim sed","returnId":92143490.11591995}],"images":"/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg","statusText":"待审核","productBarcode":"laborum cillum adipisicing ad velit","categoryName":"电冰箱","workOrderId":12532424.255793735,"workOrderNumber":"OR20150327000003","brandName":"长虹(CHANGHONG)","express":{"orderId":-47061242.5943119,"status":-71113301.69277315,"name":"sit in","phoneNumber":"voluptate dolor commodo","areaCode":3163523.565223247,"address":"sed consectetur aliqua","createTime":"occaecat fugiat in mollit","deliveryTime":"consectetur anim","updateTime":"velit non enim ut","com":"qui sint cillum","remark":"sed nostrud cillum","number":"veniam nulla"},"supplierId":659667.8267708272,"productId":87457975.53702831,"productModel":"ex","measures":"do in non"},{"id":79910321.25893903,"type":-92755715.85938272,"orderNumber":"dolore","uid":32045129.492245644,"workerId":-87225497.55755508,"siteId":929206.9191809446,"status":-49628754.46400306,"totalPriceApply":-86759265.47973964,"totalPriceOuter":77774648.6038025,"totalPriceWarranty":-43192184.70357793,"totalPriceActual":63259397.26451972,"warehouseId":-51540398.5483279,"applyRemark":"ut","deliverRemark":"est labore dolor","createTime":"consectetur","updateTime":"ut velit tempor irure mollit","items":[{"id":-59145028.86317692,"orderId":-11320686.899104223,"name":"enim","partId":49736274.59968069,"status":95250295.35558042,"quantity":-81208607.06551526,"priceApply":-8044619.175376594,"priceActual":-48277760.54597996,"returnType":64159297.29585245,"useCount":84371931.03454325,"createTime":"esse ea dolor anim nulla","updateTime":"laborum reprehenderit sit veniam","returnId":24299761.634605184}],"images":"/rest/file/image/parts/invoice_1591333116039992.jpg,/rest/file/image/parts/invoice_1591333116048870.jpg","statusText":"待审核","productModel":"ut sint dolor reprehenderit eu","brandName":"长虹(CHANGHONG)","productBarcode":"reprehenderit laboris Lorem tempor","measures":"irure elit pariatur","supplierId":-36938327.731029876,"workOrderId":78526155.84958395,"express":{"orderId":-49350095.5799381,"status":29255996.85214384,"name":"irure labore","phoneNumber":"dolor mollit pariatur consectetur","areaCode":43876681.307484895,"address":"ipsum enim dolor nostrud proident","createTime":"in pariatur eiusmod","deliveryTime":"ea","updateTime":"aute","remark":"ut id magna","number":"eu Ut","com":"dolor culpa non Ut"},"productId":-58537035.058075525,"workOrderNumber":"OR20150327000003","categoryName":"电冰箱"}]
let list = res.data || []
for (var item of list) {
item.selected = false
this.partsList.push(item)
}
this.loadStatus = list.length < this.pageSize ? 'nomore' : 'loadmore'
} else {
console.log(res.message);
}
this.loaded = true
});
},
handleOperate(info) {
// 调接口
// 修改info的status
// 刷新页面
},
handleClickCell(info) {
},
// handleClickRecords() {
// uni.navigateTo({
// url: 'pages/mine/warehouse/records'
// })
// },
handleClickSearch() {
},
handleClickBounce() {
this.showBounce = false
},
allSelect() {
},
handleSubmit() {
},
onRestore() {
this.triggered = 'restore'; // 需要重置
},
reloadPartsList() { // 第一页数据
this.pageNumber = 0
this.loadStatus = 'loading'
this.getReserveList()
},
reachBottom(e) {
if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading'
this.getReserveList()
},
}
};
</script>
<style lang="scss" scoped>
.ware-house-spare {
padding: 0 30rpx;
height: 100vh;
display: flex;
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 {
display: flex;
justify-content: space-between;
align-items: center;
color: #333333;
font-weight: bold;
font-size: 32rpx;
margin: 0 10rpx 20rpx 10rpx;
.bounce-view {
padding-left: 20rpx;
padding-right: 20rpx;
color: #666666;
font-size: 26rpx;
font-weight: 400;
}
}
.tab-view {
height: 100%;
overflow: auto;
.load-more-view {
margin-bottom: 20rpx;
}
.loading-view {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 300rpx;
position: absolute;
}
}
}
</style>
<template> <template>
<view class="u-flex det-wrap"> <view class="u-flex det-wrap">
<view class="search">
<u-search
:clearabled="true"
:action-style="searchStyle"
bg-color="#fff"
v-model="keyword"
@custom="searchParts"
@search="searchParts"
></u-search>
</view>
<view class="content" v-if="lists.length > 0"> <view class="content" v-if="lists.length > 0">
<scroll-view style="height: 100%;" scroll-y="true"> <scroll-view style="height: 100%;" scroll-y="true">
<select-parts <select-parts
...@@ -9,7 +20,6 @@ ...@@ -9,7 +20,6 @@
:show-checked="true" :show-checked="true"
@numChange="numChange($event, index)" @numChange="numChange($event, index)"
@selectChange="selectChange($event, index)" @selectChange="selectChange($event, index)"
@apply="apply(index)"
></select-parts> ></select-parts>
</scroll-view> </scroll-view>
</view> </view>
...@@ -27,7 +37,7 @@ ...@@ -27,7 +37,7 @@
<submit-bar <submit-bar
:partNum="partNum" :partNum="partNum"
:num="num" :num="num"
:btnStatus="btnStatus" :btnStatus="partNum > 0"
:allChecked="allChecked" :allChecked="allChecked"
@select="allSelect" @select="allSelect"
@submit="submit" @submit="submit"
...@@ -46,48 +56,23 @@ ...@@ -46,48 +56,23 @@
}, },
data() { data() {
return { return {
lists: [ lists: [],
{ keyword: ''
id: 1,
name: "正泰漏保",
no: 'NO.202006170015',
desc: '这个空开盒子和其他的空开有什么不一样,这里可以写一下',
num: 1,
min: 1,
max: 100,
img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png",
checked: false,
disabled: true
},
{
id: 1,
name: "挚达广汽充电桩",
no: 'NO.202006170014',
desc: '这个空开盒子和其他的空开有什么不一样,这里可以写一下',
num: 3,
min: 1,
max: 5,
img: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png",
checked: false,
disabled: true
}
],
val: []
} }
}, },
computed: { computed: {
searchStyle() {
return {
color: "#2272FF"
};
},
// 配件数 // 配件数
partNum() { partNum() {
return this.lists.reduce((counter, { checked }) => checked ? counter += 1 : counter, 0) return this.lists.reduce((counter, { checked }) => checked ? counter += 1 : counter, 0)
}, },
// 总数 // 总数
num() { num() {
return this.lists.reduce((counter, { checked, num }) => checked ? counter += num : counter, 0) return this.lists.reduce((counter, { checked, quantity }) => checked ? counter += quantity : counter, 0)
},
// 按钮状态
btnStatus() {
const count = this.lists.reduce((counter, { checked }) => checked ? counter += 1 : counter, 0)
return count > 0 || false
}, },
// 全选状态 // 全选状态
allChecked() { allChecked() {
...@@ -95,12 +80,34 @@ ...@@ -95,12 +80,34 @@
return count === 0 || false return count === 0 || false
} }
}, },
created() {
this.getReserve()
},
methods: { methods: {
apply(index) { getReserve() {
this.$set(this.lists[index], 'disabled', false) const params = {
keyword: this.keyword
}
this.$u.api.getMyReserve(params).then(res => {
if (res.code === 200) {
const data = res.data || []
this.lists = data.map(v => {
v.min = 1
v.max = v.stock
v.checked = false
v.quantity = v.stock
return v
})
}
})
},
// 搜索配件
searchParts(val) {
this.keyword = val
this.getReserve()
}, },
numChange(val, index) { numChange(val, index) {
this.$set(this.lists[index], 'num', val) this.$set(this.lists[index], 'quantity', val)
}, },
selectChange(val, index) { selectChange(val, index) {
this.$set(this.lists[index], 'checked', val) this.$set(this.lists[index], 'checked', val)
...@@ -112,7 +119,16 @@ ...@@ -112,7 +119,16 @@
}) })
}, },
submit() { submit() {
console.log('submit') let pages = getCurrentPages()
let prevPage = pages[pages.length - 2]
const lists = this.lists.filter(v => v.checked).map(v => {
return {
part_id: v.skuId,
quantity: v.quantity
}
})
console.log(lists)
}, },
qnFile(src) { qnFile(src) {
return process.uniEnv.qn_base_url + src return process.uniEnv.qn_base_url + src
...@@ -123,11 +139,15 @@ ...@@ -123,11 +139,15 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.det-wrap { .det-wrap {
background: #fff;
flex-flow: column; flex-flow: column;
height: 100vh; height: 100vh;
.search {
width: 100%;
padding: 30rpx;
}
.content { .content {
border-radius: 12rpx; background: #fff;
border-radius: 30rpx 30rpx 0 0;
padding: 10rpx 10rpx 0 10rpx; padding: 10rpx 10rpx 0 10rpx;
width: 100%; width: 100%;
flex: 1; flex: 1;
......
...@@ -230,7 +230,7 @@ export default { ...@@ -230,7 +230,7 @@ export default {
submit() { submit() {
const lists = this.lists.filter(v => !v.disabled).map(v => { const lists = this.lists.filter(v => !v.disabled).map(v => {
return { return {
part_id: v.id, part_id: v.skuId,
quantity: v.quantity quantity: v.quantity
} }
}) })
......
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