|
@@ -32,14 +32,15 @@
|
|
|
<view style='padding-left:20px;color:#AFB3BF;font-size:14px;' v-if='show==false'>登记客户</view>
|
|
|
|
|
|
<!-- <view v-for='item in registeredCustomer'> -->
|
|
|
- <view class="dj-customer" v-for="(item,index) in registeredCustomer" @click="registeredCustomerClick(item,item1)">
|
|
|
- <view class="left">{{item.carNo}}</view>
|
|
|
- <view class="right">
|
|
|
- <view class="span1">{{item.shipperName}}(货)</view>
|
|
|
- <view class="">{{item.supplier}}(商)</view>
|
|
|
- </view>
|
|
|
-
|
|
|
+ <view class="dj-customer" v-for="(item,index) in registeredCustomer"
|
|
|
+ @click="registeredCustomerClick(item,item1)">
|
|
|
+ <view class="left">{{item.carNo}}</view>
|
|
|
+ <view class="right">
|
|
|
+ <view class="span1">{{item.shipperName}}(货)</view>
|
|
|
+ <view class="">{{item.supplier}}(商)</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ </view>
|
|
|
<!-- </view> -->
|
|
|
</view>
|
|
|
|
|
@@ -128,32 +129,32 @@
|
|
|
},
|
|
|
onShow() {
|
|
|
this.purchasePriceList = uni.getStorageSync('purchasePriceList')
|
|
|
- let _data = uni.getStorageSync('recentCustomers')
|
|
|
+ let _data = uni.getStorageSync('recentCustomers')
|
|
|
if (_data) {
|
|
|
- this.recentCustomers =_data
|
|
|
- for(let i=0;i<_data.length;i++){
|
|
|
- if(_data[i].shipperName){
|
|
|
+ this.recentCustomers = _data
|
|
|
+ for (let i = 0; i < _data.length; i++) {
|
|
|
+ if (_data[i].shipperName) {
|
|
|
this.recentCustomers[i].customerName = _data[i].shipperName
|
|
|
this.recentCustomers[i].customerPhone = _data[i].shipperPhone
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
} else {
|
|
|
this.recentCustomers = []
|
|
|
}
|
|
|
|
|
|
this.$api.doRequest('get', '/shippingInformation/selectShippingInformation', {
|
|
|
warehouseName: this.warehouseName,
|
|
|
- compId: uni.getStorageSync('pcUserInfo').compId,
|
|
|
+ compId: uni.getStorageSync('pcUserInfo').compId,
|
|
|
}).then(res => {
|
|
|
if (res.data.data) {
|
|
|
let _endTime = Date.parse(new Date());
|
|
|
let _startTime = ""
|
|
|
for (let i = 0; i < res.data.data.length; i++) {
|
|
|
- _startTime = new Date((res.data.data[i].validityDate + ' 00:00:00')).getTime();
|
|
|
- if (_endTime - _startTime <= 0) {
|
|
|
- this.registeredCustomer.push(res.data.data[i])
|
|
|
- }
|
|
|
+ _startTime = new Date((res.data.data[i].validityDate + ' 00:00:00')).getTime();
|
|
|
+ if (_endTime - _startTime <= 0) {
|
|
|
+ this.registeredCustomer.push(res.data.data[i])
|
|
|
+ }
|
|
|
// let _carList = res.data.data[i].shippingInformationList
|
|
|
// for (let k = 0; k < _carList.length; k++) {
|
|
|
// //判断是记录是否失效
|
|
@@ -197,13 +198,14 @@
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- registeredCustomerClick(item,item1){
|
|
|
- uni.setStorageSync('carNo', item1)
|
|
|
- uni.setStorageSync('checkcustomer', item)
|
|
|
+ registeredCustomerClick(item, item1) {
|
|
|
+ uni.setStorageSync('isClick', true)
|
|
|
+ uni.setStorageSync('carNo', item1)
|
|
|
+ uni.setStorageSync('checkcustomer', item)
|
|
|
if (this.recentCustomers.length == 0) {
|
|
|
this.recentCustomers.push(item)
|
|
|
uni.setStorageSync('recentCustomers', this.recentCustomers)
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
let _copyList = this.$u.deepClone(this.recentCustomers);
|
|
|
for (let i = 0; i < this.recentCustomers.length; i++) {
|
|
|
if (this.recentCustomers[i].customerPhone != item.shipperPhone) {
|
|
@@ -212,29 +214,30 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
uni.navigateBack()
|
|
|
},
|
|
|
checkcustomer(item) {
|
|
|
+ uni.setStorageSync('isClick', true)
|
|
|
var that = this
|
|
|
var count = ''
|
|
|
if (item.authenticationStatus == '已认证') {
|
|
|
// uni.showLoading({
|
|
|
// title: '加载中'
|
|
|
// })
|
|
|
-
|
|
|
+
|
|
|
uni.setStorageSync('checkcustomer', item)
|
|
|
if (this.recentCustomers.length == 0) {
|
|
|
this.recentCustomers.push(item)
|
|
|
uni.setStorageSync('recentCustomers', this.recentCustomers)
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
let _isDel = false
|
|
|
for (let i = 0; i < this.recentCustomers.length; i++) {
|
|
|
if (this.recentCustomers[i].customerPhone == item.customerPhone) {
|
|
|
- _isDel = true
|
|
|
+ _isDel = true
|
|
|
}
|
|
|
}
|
|
|
- if(!_isDel){
|
|
|
+ if (!_isDel) {
|
|
|
let _data = uni.getStorageSync('recentCustomers')
|
|
|
_data.push(item)
|
|
|
uni.setStorageSync('recentCustomers', _data)
|
|
@@ -370,7 +373,7 @@
|
|
|
this.currentPage = 1
|
|
|
uni.showLoading({
|
|
|
title: '正在加载',
|
|
|
- mask:true
|
|
|
+ mask: true
|
|
|
})
|
|
|
this.getList()
|
|
|
},
|
|
@@ -396,7 +399,7 @@
|
|
|
}
|
|
|
this.$api.doRequest('get', url, data).then(res => {
|
|
|
if (res.data.data) {
|
|
|
- uni.hideLoading()
|
|
|
+ uni.hideLoading()
|
|
|
let data = res.data.data.records ? res.data.data.records : res.data.data
|
|
|
//采购信息
|
|
|
if (data.length > 0) {
|
|
@@ -1041,7 +1044,8 @@
|
|
|
|
|
|
.right {
|
|
|
display: flex;
|
|
|
- .span1{
|
|
|
+
|
|
|
+ .span1 {
|
|
|
margin-right: 20rpx;
|
|
|
}
|
|
|
}
|