Commit adcdc662 authored by Damon's avatar Damon

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

parents 33b41120 53744f01
...@@ -184,6 +184,11 @@ let orderApiFun = function(vm){ ...@@ -184,6 +184,11 @@ let orderApiFun = function(vm){
let fileList = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file', params); let fileList = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file', params);
// 订单配件列表 // 订单配件列表
let applyList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders', params); let applyList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders', params);
// 返件列表
let returnedParts = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/return', params);
// 备件仓列表
let reserveList = async (params = {}) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/items/reserve', params);
const orderApi = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
listOrderCount, listOrderCount,
...@@ -228,7 +233,9 @@ let orderApiFun = function(vm){ ...@@ -228,7 +233,9 @@ let orderApiFun = function(vm){
fileLabel, fileLabel,
fileList, fileList,
completeNextStep, completeNextStep,
applyList applyList,
returnedParts,
reserveList
} }
return orderApi return orderApi
} }
......
...@@ -133,12 +133,12 @@ ...@@ -133,12 +133,12 @@
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
&.image { &.image {
margin-right: 40rpx; margin-right: 22rpx;
} }
&.text { &.text {
width: 400rpx; width: 360rpx;
margin-left: 40rpx; margin-left: 18rpx;
&.one { &.one {
width: 600rpx; width: 600rpx;
margin-left: 0rpx; margin-left: 0rpx;
......
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
<view class="top"> <view class="top">
<view class="item"> <view class="item">
<view class="left">收货人</view> <view class="left">收货人</view>
<input disabled v-model="name" type="text" placeholder-class="line" placeholder="请填写收货人姓名" /> <input :disabled="nameStatus" v-model="name" type="text" placeholder-class="line" placeholder="请填写收货人姓名" />
</view> </view>
<view class="item"> <view class="item">
<view class="left">手机号码</view> <view class="left">电话号码</view>
<input disabled v-model="mobile" type="text" placeholder-class="line" placeholder="请填写收货人手机号" /> <input :disabled="mobileStatus" v-model="mobile" type="text" placeholder-class="line" placeholder="请填写收货人手机号" />
</view> </view>
<view class="item"> <view class="item">
<view class="left">所在地区</view> <view class="left">所在地区</view>
<input @tap="showRegionPicker" disabled v-model="region" type="text" placeholder-class="line" placeholder="省市区县、乡镇等" /> <input @tap="showRegionPicker" disabled v-model="formatRegion" type="text" placeholder-class="line" placeholder="省市区县、乡镇等" />
<u-icon @click="autoLocation" class="right" name="map" label="定位" label-size="24" label-color="#2272FF" /> <u-icon @click="autoLocation" class="right" name="map" label="定位" label-size="24" label-color="#2272FF" />
</view> </view>
<u-field <u-field
class="item-address" class="item-address"
...@@ -26,13 +26,10 @@ ...@@ -26,13 +26,10 @@
type="textarea" type="textarea"
:auto-height="false" :auto-height="false"
:border-bottom="false" :border-bottom="false"
> ></u-field>
</u-field>
</view> </view>
<view class="bottom"> <view class="bottom">
<button class="btn, bottom-btn" @click="show = true"> <button class="btn, bottom-btn" @click="show = true"><text class="button-text">保存</text></button>
<text class="button-text">保存</text>
</button>
<!-- <view class="default"> <!-- <view class="default">
<view class="left"> <view class="left">
<view class="set">设置默认地址</view> <view class="set">设置默认地址</view>
...@@ -41,149 +38,211 @@ ...@@ -41,149 +38,211 @@
<view class="right"><switch color="red" @change="setDefault" /></view> <view class="right"><switch color="red" @change="setDefault" /></view>
</view> --> </view> -->
</view> </view>
<u-picker mode="region" ref="uPicker" v-model="showPicker" :params="params" @confirm="confirmRegion" /> <u-picker mode="region" v-model="showPicker" :default-region="region" @confirm="confirmRegion" />
<u-popup <u-popup border-radius="12" width="690" height="520" v-model="show" mode="center">
border-radius="12"
width="690"
height="520"
v-model="show"
mode="center">
<view class="save-pop"> <view class="save-pop">
<view class="header">确认保存信息</view> <view class="header">确认保存信息</view>
<view class="content"> <view class="content"><view class="tips">您填写的信息尚未保存,是否保存</view></view>
<view class="tips">您填写的信息尚未保存,是否保存</view>
</view>
</view> </view>
<view class="pop-bottom"> <view class="pop-bottom">
<button class="plain" @click="show = false" shape="circle" :plain="true">不保存</button> <button class="plain" @click="show = false" shape="circle" :plain="true">不保存</button>
<button <u-button :custom-style="submitBtn" shape="circle" @click="submitForm" :disabled="disabledSubmit">保存</u-button>
class="solid"
shape="circle"
@click="$u.throttle(submitForm, 500)"
:loading="submiting"
:disabled="disabledSubmit">保存</button>
</view> </view>
</u-popup> </u-popup>
</view> </view>
</template> </template>
<script> <script>
let r = require("libs/bmap-wx.min.js"); /**
* addSite 新增地址|修改地址|选择地址(返回选择地址信息)
* @description 编辑地址共通页
* @property {String} type 编辑类型(默认为修改,add--新增、edit--修改、select--选择)
* @property {String} info 地址信息(json字符串:包含地址信息)
*/
let r = require('libs/bmap-wx.min.js');
let h = new r.BMapWX({ let h = new r.BMapWX({
ak: process.uniEnv.bmapAK // ak: process.uniEnv.bmapAK,
ak: 'G1wPip2Oj62NnoUctXhiE1faZVHbeo2A'
}); });
export default { export default {
data() { data() {
return { return {
title: '新增地址', title: '修改地址',
siteInfo: null,
siteType: 'edit',
show: false, show: false,
location: '', location: '',
address: '', address: '',
type: '充电桩安装', type: '充电桩安装',
name: '--', name: '',
mobile: '', mobile: '',
nameStatus: true,
mobileStatus: true,
settled: null, settled: null,
region: [], adcode: '',
regionObj: [], regionObj: [],
region: [],
showPicker: false, showPicker: false,
params: { loading: true
province: true,
city: true,
area: true
},
}; };
}, },
computed: {}, computed: {
formatRegion() {
return this.region.join(' ');
},
submitBtn() {
return {
color: '#FFFFFF',
backgroundColor: '#2272FF'
};
}
},
async onLoad(e) { async onLoad(e) {
getApp().trackPage('我的收获地址修改页') getApp().trackPage('我的收获地址修改页');
if(e && e.title) { if (!this.vuex_token) {
this.title = decodeURIComponent(e.title) this.$u.route({ url: 'pages/login/index' });
} }
if(!this.vuex_token) { if (e) {
this.$u.route({url: 'pages/login/index'}) if (e.type === 'add') {
this.title = '新增地址';
this.siteType = 'add';
} else if (e.type === 'select') {
this.title = '选择地址';
this.siteType = 'select';
} else if (e.info && this.$u.test.jsonString(e.info)) {
// 默认修改我的地址
this.siteInfo = JSON.parse(decodeURIComponent(e.info));
} else if (e.type == 'edit') {
this.title = '修改地址';
this.siteType = 'edit';
}
} }
},
onShow() {
this.getData(); this.getData();
}, },
methods: { methods: {
async getData() { getData() {
const callback = (vm, res) => { if (this.siteType == 'add' || this.siteType == 'select') {
vm.settled = res.record this.nameStatus = false;
vm.address = vm.settled.address this.mobileStatus = false;
vm.name = vm.settled.id_card_name } else if (this.siteType == 'edit') {
vm.mobile = vm.settled.mobile let address = '';
} if (this.$u.test.isEmpty(this.siteInfo)) {
if(this.vuex_settled && this.vuex_settled.record || null) { const callback = (vm, res) => {
callback(this, this.vuex_settled) this.settled = res.record;
if (this.loading) {
this.name = this.settled.id_card_name;
this.mobile = this.settled.mobile;
this.address = this.settled.address;
this.geocoding();
}
this.loading = this.$u.test.isEmpty(this.settled);
};
if (this.vuex_settled && this.vuex_settled.record) {
callback(this, this.vuex_settled);
} else {
getApp().getBaseInfo(this, callback);
}
} else {
if (this.loading) {
this.loading = false;
this.name = this.siteInfo.name;
this.mobile = this.siteInfo.mobile;
this.address = this.siteInfo.address;
this.geocoding();
}
}
} }
getApp().getBaseInfo(this, callback);
}, },
showRegionPicker() { showRegionPicker() {
this.showPicker = true this.showPicker = true;
}, },
confirmRegion(params) { confirmRegion(params) {
this.regionObj = params this.regionObj = params;
this.region = params.province.label+params.city.label+params.area.label this.region = [params.province.label, params.city.label, params.area.label];
}, },
/** /**
* 百度定位 * 百度定位
* @param {Object} long * @param {Object} long
* @param {Object} lat * @param {Object} lat
*/ */
baiduLocation(long, lat) { regeocoding(lat, long) {
console.log("11111111111", this.title)
let t = {
success: (res) => {
console.log('success:', res)
let e = res.wxMarkerData[0];
let i = e.address;
this.location = i;
},
fail: (res) => {
console.log('fail:', res)
}
}
if (lat && long) { if (lat && long) {
let e = lat + "," + long h.regeocoding({
t.location = e location: lat + ',' + long,
// t.coordtype = 'wgs84' success: data => {
// t.latitude = lat console.log('regeocoding[success]:', data);
// t.longitude = long this.location = data.wxMarkerData[0];
console.log('regeocoding:', t) let regeocod = data.originalData.result.addressComponent;
h.regeocoding(t); this.adcode = regeocod.adcode;
this.region = [regeocod.province, regeocod.city, regeocod.district];
let region = this.region.join('');
if (this.$u.test.contains(this.address, region)) {
this.address = this.address.replace(region, '');
}
},
fail: res => {
console.log('regeocoding[fail]:', res);
}
});
} }
}, },
geocoding() {
if (this.address) {
let t = {
success: res => {
console.log('[geocoding][success]:', res);
let e = res.wxMarkerData[0];
if (e.longitude && e.latitude) {
this.regeocoding(e.latitude, e.longitude);
}
},
fail: res => {
console.log('[geocoding][fail]:', res);
}
};
t.address = this.address;
h.geocoding(t);
}
},
/** /**
* 自动定位 * 自动定位
*/ */
autoLocation() { autoLocation() {
let that = this let that = this;
uni.chooseLocation({ uni.chooseLocation({
success: (res) => { success: res => {
this.baiduLocation(res.longitude, res.latitude) this.address = res.address + res.name;
this.regeocoding(res.latitude, res.longitude);
}, },
fail: function(res) { fail: function(res) {
// uni.showToast({ console.log('chooseLocation[fail]:', res);
// title: '定位失败'
// })
} }
}); });
}, },
async submitForm() { async submitForm() {
let self = this if (this.siteType === 'add') {
let params = { } else if (this.siteType === 'select') {
type: self.type, } else if (this.siteType === 'edit') {
address: self.address if (this.$u.test.isEmpty(this.siteInfo)) {
} let params = {
let res = await self.$u.api.syncAddress(params) type: this.type,
const callback = (vm, res) => { address: this.region.join("") + this.address
vm.$u.route({type: 'back'}) };
} let res = await this.$u.api.syncAddress(params);
if(res && res.code == 200) { const callback = (vm, res) => {
getApp().getBaseInfo(this, callback); this.$u.route({ type: 'back' });
this.show = false
};
if (res && res.code == 200) {
getApp().getBaseInfo(this, callback);
}
} else {
}
} }
} }
} }
...@@ -196,7 +255,7 @@ export default { ...@@ -196,7 +255,7 @@ export default {
font-size: 28rpx; font-size: 28rpx;
} }
.wrap { .wrap {
background-color: #FFFFFF; background-color: #ffffff;
width: 750rpx; width: 750rpx;
height: 100vh; height: 100vh;
.top { .top {
...@@ -209,7 +268,7 @@ export default { ...@@ -209,7 +268,7 @@ export default {
color: #333333; color: #333333;
line-height: 88rpx; line-height: 88rpx;
align-items: center; align-items: center;
border-bottom: solid 2rpx #F4F5F7; border-bottom: solid 2rpx #f4f5f7;
.left { .left {
width: 160rpx; width: 160rpx;
color: #999999; color: #999999;
...@@ -218,15 +277,14 @@ export default { ...@@ -218,15 +277,14 @@ export default {
text-align: left; text-align: left;
flex: auto; flex: auto;
} }
.textarea { .textarea {
} }
.right { .right {
margin-left: 30rpx; margin-left: 30rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: 400; font-weight: 400;
color: #2272FF; color: #2272ff;
} }
} }
.item-address { .item-address {
...@@ -236,7 +294,7 @@ export default { ...@@ -236,7 +294,7 @@ export default {
/deep/ .u-field { /deep/ .u-field {
padding: 0; padding: 0;
padding-top: 30rpx; padding-top: 30rpx;
border-bottom: solid 2rpx #F4F5F7; border-bottom: solid 2rpx #f4f5f7;
.u-label { .u-label {
color: #999999; color: #999999;
line-height: normal; line-height: normal;
...@@ -257,7 +315,7 @@ export default { ...@@ -257,7 +315,7 @@ export default {
margin-left: 30rpx; margin-left: 30rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: 400; font-weight: 400;
color: #2272FF; color: #2272ff;
align-self: top; align-self: top;
} }
} }
...@@ -281,7 +339,7 @@ export default { ...@@ -281,7 +339,7 @@ export default {
} }
} }
} }
.save-pop { .save-pop {
padding: 0 30rpx; padding: 0 30rpx;
.header { .header {
...@@ -289,7 +347,7 @@ export default { ...@@ -289,7 +347,7 @@ export default {
font-size: 40rpx; font-size: 40rpx;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
border-bottom: solid 2rpx #F4F5F7; border-bottom: solid 2rpx #f4f5f7;
line-height: 40rpx; line-height: 40rpx;
padding: 60rpx 0 40rpx 0; padding: 60rpx 0 40rpx 0;
} }
...@@ -304,8 +362,6 @@ export default { ...@@ -304,8 +362,6 @@ export default {
line-height: 28rpx; line-height: 28rpx;
} }
} }
} }
/deep/ .pop-bottom { /deep/ .pop-bottom {
padding: 0 16rpx; padding: 0 16rpx;
...@@ -319,12 +375,12 @@ export default { ...@@ -319,12 +375,12 @@ export default {
padding: 0; padding: 0;
} }
.plain { .plain {
border: 2px solid #2272FF; border: 2px solid #2272ff;
color: #2272FF; color: #2272ff;
} }
.solid { .solid {
color: #FFFFFF; color: #ffffff;
background-color: #2272FF; background-color: #2272ff;
} }
} }
} }
......
...@@ -58,9 +58,9 @@ export default { ...@@ -58,9 +58,9 @@ export default {
toAddSite(title){ toAddSite(title){
this.$u.route({ this.$u.route({
url: 'pages/mine/address/addSite', url: 'pages/mine/address/addSite',
params: { // params: {
title: title // title: title
} // }
}) })
} }
} }
......
<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">
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
inactive-color="#666" button-color="#2272FF" bparts-radius="36" @change="sectionChange" height="72" inactive-color="#666" button-color="#2272FF" bparts-radius="36" @change="sectionChange" height="72"
bold> bold>
</u-subsection> </u-subsection>
</view> </view>
<u-button class="right-btn" @click="handleClickRecords" :custom-style="buttonStyle" type="primary" <u-button class="right-btn" @click="handleClickRecords" :custom-style="buttonStyle" type="primary"
shape="circle">操作记录</u-button> shape="circle">操作记录</u-button>
<view class="search-btn" @click="handleClickSearch"> <view class="search-btn" @click="handleClickSearch">
<image class="search-image" mode="widthFix" :src="sousuoImage"></image> <image class="search-image" mode="widthFix" :src="sousuoImage"></image>
...@@ -18,16 +18,16 @@ ...@@ -18,16 +18,16 @@
</view> </view>
<view class="u-tabs-box"> <view class="u-tabs-box">
<u-tabs height="66" activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4" <u-tabs height="66" activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4"
bar-width="44" :offset="[0,0]" :list="list[curNow]" count="total" :current="current[curNow]" @change="change" bar-width="44" :offset="[0,0]" :list="list[curNow]" count="total" :current="current[curNow]"
:is-scroll="false" font-size="28" bold></u-tabs> @change="change" :is-scroll="false" font-size="28" bold></u-tabs>
</view> </view>
<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" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
:scroll-top="scrollTop" refresher-background="#F4F5F7" @refresherpulling="triggered = true" :scroll-top="scrollTop" refresher-background="#F4F5F7" @refresherpulling="triggered = true"
@refresherrefresh="onRefresh" @refresherrestore="onRestore" @scroll="scroll" enable-back-to-top> @refresherrefresh="onRefresh" @refresherrestore="onRestore" enable-back-to-top>
<NoOrder v-if="noMore" type="black" :customStyle="noPartsCustomStyle" /> <NoOrder v-if="noParts" type="black" :customStyle="noPartsCustomStyle" />
<template v-else> <template v-else>
<view v-for="(item, index) in partsList" :key="item.id"> <view v-for="(item, index) in partsList" :key="item.id">
<AppliedCell @operate="handleOperate" :info="item"></AppliedCell> <AppliedCell @operate="handleOperate" :info="item"></AppliedCell>
...@@ -39,6 +39,17 @@ ...@@ -39,6 +39,17 @@
</template> </template>
</scroll-view> </scroll-view>
</view> </view>
<view class="bottom-view" v-if="isReserve">
<view class="selected-all-view" @click="radioChange">
<u-icon class="selected-all-icon" name="checkbox-mark" :color="radioColor"></u-icon>
<text>全选</text>
</view>
<view class="right-view">
<u-button class="scd-btn" @click="handleClickRecords" :custom-style="buttonStyle" type="primary"
shape="circle">{{buttonText}}</u-button>
</view>
</view>
</view> </view>
</template> </template>
...@@ -57,42 +68,43 @@ ...@@ -57,42 +68,43 @@
pageNumber: 0, pageNumber: 0,
pageSize: 100, pageSize: 100,
partsList: [], partsList: [],
current: [0, 0], current: [0, 0], // [未入库index, 已入库index]
loadStatus: 'loading', loadStatus: 'loading',
dataValue: [],
loaded: false, loaded: false,
triggered: false, triggered: false,
_freshing: false, _freshing: false,
scrollTop: 0, scrollTop: 0,
old: { selectedAll: false,
scrollTop: 0
}
}; };
}, },
computed: { computed: {
// -1 已驳回,-1 已取消,0 新申请,1 待审核,10 待发货,11 配货中,12 采购中,15 已发货,20 已签收,21 待返件,22 返件中,90 已转备件,100 已完成 // 待签收 15;待发货 10;待审核 1;已驳回 -2;已签收 20;已取消 -1;
list() { list() {
return [ return [
[{ [{
'name': '代签收', 'name': '代签收',
'status': '' 'status': 15
}, },
{ {
'name': '代发货', 'name': '代发货',
'status': '' 'status': 10
}, },
{ {
'name': '代审核', 'name': '代审核',
'status': '' 'status': 1
},
{
'name': '已驳回',
'status': -2
},
{
'name': '已签收',
'status': 20
}, },
{ {
'name': '已取消', 'name': '已取消',
'status': '' 'status': -1
}, },
{
'name': '已签收',
'status': ''
}
], ],
[{ [{
'name': '备件仓', 'name': '备件仓',
...@@ -105,39 +117,52 @@ ...@@ -105,39 +117,52 @@
] ]
] ]
}, },
subList() { subList() {
return ['未入库', '已入库'] return ['未入库', '已入库']
}, },
currentTab() { currentTab() {
return this.list[this.curNow][this.current[this.curNow]] return this.list[this.curNow][this.currentIndex]
}, },
sousuoImage() { sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png' return process.uniEnv.qn_base_url + 'sousuo.png'
}, },
noMore() { noParts() {
return this.partsList.length == 0 && this.loaded return this.partsList.length == 0 && this.loaded
}, },
noPartsCustomStyle() { noPartsCustomStyle() {
return this.curNow == 0 ? 'margin-top: 100rpx;background-color: #F4F5F7' : return this.curNow == 0 ? 'margin-top: 100rpx;background-color: #F4F5F7' :
'margin-top: 200rpx;background-color: #F4F5F7' 'margin-top: 200rpx;background-color: #F4F5F7'
}, },
buttonStyle() { buttonStyle() {
return { return {
'background-color': '#2272FF', 'background-color': '#2272FF',
'color': '#FFFFFF', 'color': '#FFFFFF',
'font-size': '32rpx', 'font-size': '32rpx',
'height': '80rpx', 'height': '80rpx',
'width': '200rpx' 'width': '200rpx'
} }
},
radioColor() {
return this.selectedAll ? '#2272FF' : 'transparent'
},
currentIndex() { // 当前tab的index
return this.current[this.curNow]
},
buttonTexts() {
return [['签收', '', '取消申请', '', ''], ['退件', '']]
},
buttonText() {
return this.buttonTexts[this.curNow][this.currentIndex]
},
isReserve() { // 选中备件仓
return this.curNow == 1 && this.currentIndex == 0
} }
}, },
onLoad(e) { onLoad(e) {
getApp().trackPage('我的仓库列表页') getApp().trackPage('我的仓库列表页')
this.reloadPartsList()
this._freshing = false; this._freshing = false;
}, },
onShow() {
this.reloadPartsInfo()
},
methods: { methods: {
sectionChange(index) { sectionChange(index) {
this.curNow = index; this.curNow = index;
...@@ -149,35 +174,28 @@ ...@@ -149,35 +174,28 @@
this.reloadPartsList() this.reloadPartsList()
}, },
reachBottom(e) { // 页面数据:未入库
if (this.loadStatus != 'loadmore') return getUnstockedList(status) {
this.loadStatus == 'loading'
this.getPartsList(this.currentTab)
},
// 页面数据
getPartsList(index) {
// 状态处理 // 状态处理
this.pageNumber += 1 this.pageNumber += 1
this.loaded = false this.loaded = false
var param = { var param = {
pageNumber: this.pageNumber, 'pageSize': 20,
pageSize: this.pageSize, 'pageNumbr': 1,
keyword: '', 'status': status, //不传值 全部;待签收 15;待发货 10;待审核 1;已取消 -1;已驳回 -2;已签收 20
type: 0 // 'workOrderId': ''
} }
var self = this; this.$u.api.applyList(param).then((res) => {
self.$u.api.listBystock(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.data.type != self.partsType) return if (res.data.type != this.partsType) return
self.triggered = false; this.triggered = false;
self._freshing = false; this._freshing = false;
if (self.pageNumber == 1) { if (this.pageNumber == 1) {
self.partsList = [] this.partsList = []
} }
if (res.data.list) { if (res.data.list) {
self.partsList.push(...res.data.list) this.partsList.push(...res.data.list)
self.loadStatus = res.data.total > self.partsList.length && res.data.list.length == this.loadStatus = res.data.list.length < this.pageSize ? 'nomore' : 'loadmore'
self.pageSize ? 'loadmore' : 'nomore'
} }
} else { } else {
console.log(res.message, "获取订单数量失败!"); console.log(res.message, "获取订单数量失败!");
...@@ -186,36 +204,104 @@ ...@@ -186,36 +204,104 @@
}); });
}, },
getReturnedParts(status) { // 返件列表
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 (res.data.type != this.partsType) return
this.triggered = false;
this._freshing = false;
if (this.pageNumber == 1) {
this.partsList = []
}
if (res.data.list) {
this.partsList.push(...res.data.list)
this.loadStatus = res.data.list.length < this.pageSize ? 'nomore' : 'loadmore'
}
} else {
console.log(res.message, "获取订单数量失败!");
}
this.loaded = true
});
},
getReserveList() { // 备件列表
this.pageNumber += 1
this.loaded = false
this.$u.api.reserveList(param).then((res) => {
if (res.code == 200) {
if (res.data.type != this.partsType) return
this.triggered = false;
this._freshing = false;
if (this.pageNumber == 1) {
this.partsList = []
}
if (res.data.list) {
this.partsList.push(...res.data.list)
this.loadStatus = res.data.list.length < this.pageSize ? 'nomore' : 'loadmore'
}
} else {
console.log(res.message, "获取订单数量失败!");
}
this.loaded = true
});
},
handleOperate(type) { handleOperate(type) {
// 调接口 // 调接口
// 刷新页面 // 刷新页面
}, },
handleClickRecords() { handleClickRecords() {
uni.navigateTo({ uni.navigateTo({
url: 'pages/mine/warehouse/records' url: 'pages/mine/warehouse/records'
}) })
}, },
handleClickSearch() { handleClickSearch() {
uni.navigateTo({ uni.navigateTo({
url: 'pages/order/search' url: 'pages/order/search'
}) })
},
radioChange(e) {
this.selectedAll = !this.selectedAll
}, },
onRefresh() { onRefresh() {
if (this._freshing) return; if (this._freshing) return;
this._freshing = true; this._freshing = true;
this.reloadPartsInfo() this.reloadPartsList()
}, },
onRestore() { onRestore() {
this.triggered = 'restore'; // 需要重置 this.triggered = 'restore'; // 需要重置
}, },
reloadPartsInfo() { reloadPartsList() { // 第一页数据
this.reloadPartsList()
},
reloadPartsList() {
this.pageNumber = 0 this.pageNumber = 0
this.loadStatus = 'loading' this.loadStatus = 'loading'
this.getPartsList(this.currentTab); this.loadPartsList()
},
loadPartsList() {
if (this.curNow == 0) { // 未入库
this.getUnstockedList(this.currentTab.status);
} else { // 已入库
if (this.currentIndex == 0) {
// 备件仓
this.getReserveList()
} else {
// 已返件
this.getReturnedParts()
}
}
},
reachBottom(e) {
if (this.isReserve) this.loadStatus = 'nomore' // 已入库的备件仓没有分页
if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading'
this.loadPartsList()
}, },
scroll(e) { scroll(e) {
this.old.scrollTop = e.detail.scrollTop this.old.scrollTop = e.detail.scrollTop
...@@ -226,10 +312,14 @@ ...@@ -226,10 +312,14 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.ware-house { .ware-house {
padding: 0 30rpx 20rpx 30rpx;
height: 100vh;
display: flex;
flex-direction: column;
.u-tabs-box { .u-tabs-box {
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.tab-view { .tab-view {
height: 100%; height: 100%;
overflow: auto; overflow: auto;
...@@ -273,6 +363,27 @@ ...@@ -273,6 +363,27 @@
font-size: 26rpx; font-size: 26rpx;
} }
} }
}
.bottom-view {
display: flex;
justify-content: space-around;
align-items: center;
.selected-all-view {
.selected-all-icon {
border: 2rpx solid #666666;
}
}
.right-view {
display: flex;
align-items: center;
.fst-btn {
}
.scd-btn {
}
}
} }
} }
</style> </style>
<template> <template>
<view class="ware-wrap"> <view class="ware-wrap">
<w-navbar title="操作记录" :background="{backgroundColor: '#F4F5F7'}"></w-navbar> <w-navbar title="" :background="{backgroundColor: '#F4F5F7'}"></w-navbar>
<view class="content"> <!-- <view class="content">
<view class="panel"> <view class="panel">
<view class="title">物料明细</view> <view class="title">物料明细</view>
<view class="item-table"> <view class="item-table">
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
<view class="width-106 center">{{ item.systemStock }}</view> <view class="width-106 center">{{ item.systemStock }}</view>
</view> </view>
</view> </view>
</view> </view> -->
<view class="panel"> <view class="panel">
<view class="title">操作记录</view> <!-- <view class="title">操作记录</view> -->
<view class="item-table"> <view class="item-table">
<view class="item-header"> <view class="item-header">
<view class="width-132">订单编号</view> <view class="width-132">订单编号</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