|
@@ -22,18 +22,23 @@
|
|
<view v-else> {{item.customerName}}({{item.customerPhone}}) </view>
|
|
<view v-else> {{item.customerName}}({{item.customerPhone}}) </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view v-for='item in gridList' style='display:inline-block;'>
|
|
|
|
- <view @click='recentcustomer(item)' class='wrap' v-if='show==false'>{{item.searchContent}}</view>
|
|
|
|
|
|
+ <view v-for='item in recentCustomers' style='display:inline-block;'>
|
|
|
|
+ <view @click='recentcustomer(item)' class='wrap' v-if='show==false'>
|
|
|
|
+ {{item.customerName}}({{item.customerPhone}})
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="content content1">
|
|
<view class="content content1">
|
|
<view style='padding-left:20px;color:#AFB3BF;font-size:14px;' v-if='show==false'>登记客户</view>
|
|
<view style='padding-left:20px;color:#AFB3BF;font-size:14px;' v-if='show==false'>登记客户</view>
|
|
-
|
|
|
|
- <view v-for='item in gridList'>
|
|
|
|
- <view class="row">
|
|
|
|
- <view class="row-item">辽H12345</view>
|
|
|
|
- <view class="row-item">张三(货)</view>
|
|
|
|
- <view class="row-item">李四(商)</view>
|
|
|
|
|
|
+
|
|
|
|
+ <view v-for='item in registeredCustomer'>
|
|
|
|
+ <view class="dj-customer" @click="registeredCustomerClick(item)">
|
|
|
|
+ <view class="left">{{item.carNo}}</view>
|
|
|
|
+ <view class="right">
|
|
|
|
+ <view class="">{{item.shipperName}}(货)</view>
|
|
|
|
+ <view class="">{{item.supplier}}(商)</view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -93,8 +98,9 @@
|
|
purchasePriceList: [],
|
|
purchasePriceList: [],
|
|
warehouseCount: '',
|
|
warehouseCount: '',
|
|
commonWarehouseNo: '',
|
|
commonWarehouseNo: '',
|
|
- cangid: ''
|
|
|
|
-
|
|
|
|
|
|
+ cangid: '',
|
|
|
|
+ recentCustomers: [],
|
|
|
|
+ registeredCustomer: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -109,6 +115,7 @@
|
|
},
|
|
},
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
this.cangid = options.cangid
|
|
this.cangid = options.cangid
|
|
|
|
+ this.warehouseName = options.warehouseName
|
|
this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
|
|
this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
|
|
warehouseId: this.cangid
|
|
warehouseId: this.cangid
|
|
}).then(res => {
|
|
}).then(res => {
|
|
@@ -120,26 +127,59 @@
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
this.purchasePriceList = uni.getStorageSync('purchasePriceList')
|
|
this.purchasePriceList = uni.getStorageSync('purchasePriceList')
|
|
- this.gridList = []
|
|
|
|
- this.$api.doRequest('get', '/searchRecordsInfo/selectSearchRecordsInfo', {
|
|
|
|
- pageSize: this.pageSize,
|
|
|
|
- currentPage: this.currentPage,
|
|
|
|
- functionType: "3",
|
|
|
|
- commonId: this.userInfo.id
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.data.data) {
|
|
|
|
- this.gridList = res.data.data.records
|
|
|
|
- console.log(this.gridList)
|
|
|
|
|
|
+ let _data = uni.getStorageSync('recentCustomers')
|
|
|
|
+ if (_data) {
|
|
|
|
+ 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
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- })
|
|
|
|
- this.$api.doRequest('get', '/identityAuthenticationInfo/identityAuthenticationInfoCustomer', {
|
|
|
|
- compId: '',
|
|
|
|
- authenticationStatusKey: 7,
|
|
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ this.recentCustomers = []
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.$api.doRequest('get', '/grainDeliveryRegistration/grainDeliveryRegistrationCustomer', {
|
|
|
|
+ warehouseName: this.warehouseName
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.data.data) {
|
|
if (res.data.data) {
|
|
- this.customerList = res.data.data
|
|
|
|
|
|
+ let _endTime = Date.parse(new Date());
|
|
|
|
+ let _startTime = ""
|
|
|
|
+ for (let i = 0; i < res.data.data.length; i++) {
|
|
|
|
+ let _carList = res.data.data[i].shippingInformationList
|
|
|
|
+ for (let k = 0; k < _carList.length; k++) {
|
|
|
|
+ //判断是记录是否失效
|
|
|
|
+ _startTime = new Date((res.data.data[i].validityDate + ' 00:00:00')).getTime();
|
|
|
|
+ if (_endTime - _startTime <= 0) {
|
|
|
|
+ this.registeredCustomer.push(_carList[k])
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log(this.registeredCustomer)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ // this.$api.doRequest('get', '/searchRecordsInfo/selectSearchRecordsInfo', {
|
|
|
|
+ // pageSize: this.pageSize,
|
|
|
|
+ // currentPage: this.currentPage,
|
|
|
|
+ // functionType: "3",
|
|
|
|
+ // commonId: this.userInfo.id
|
|
|
|
+ // }).then(res => {
|
|
|
|
+ // if (res.data.data) {
|
|
|
|
+ // this.gridList = res.data.data.records
|
|
|
|
+ // console.log(this.gridList)
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // this.$api.doRequest('get', '/identityAuthenticationInfo/identityAuthenticationInfoCustomer', {
|
|
|
|
+ // compId: uni.getStorageSync('pcUserInfo').compId,
|
|
|
|
+ // authenticationStatusKey: 7,
|
|
|
|
+ // searchKeyWord:''
|
|
|
|
+ // }).then(res => {
|
|
|
|
+ // if (res.data.data) {debugger
|
|
|
|
+ // this.customerList = res.data.data
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
searchinput(e) {
|
|
searchinput(e) {
|
|
@@ -149,129 +189,161 @@
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
|
|
+ registeredCustomerClick(item){debugger
|
|
|
|
+
|
|
|
|
+ uni.setStorageSync('checkcustomer', item)
|
|
|
|
+ if (this.recentCustomers.length == 0) {
|
|
|
|
+ this.recentCustomers.push(item)
|
|
|
|
+ uni.setStorageSync('recentCustomers', this.recentCustomers)
|
|
|
|
+ }else{
|
|
|
|
+ let _copyList = this.$u.deepClone(this.recentCustomers);
|
|
|
|
+ for (let i = 0; i < this.recentCustomers.length; i++) {
|
|
|
|
+ if (this.recentCustomers[i].customerPhone != item.shipperPhone) {
|
|
|
|
+ _copyList.push(item)
|
|
|
|
+ uni.setStorageSync('recentCustomers', _copyList)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ uni.navigateBack()
|
|
|
|
+ },
|
|
checkcustomer(item) {
|
|
checkcustomer(item) {
|
|
-
|
|
|
|
var that = this
|
|
var that = this
|
|
var count = ''
|
|
var count = ''
|
|
if (item.authenticationStatus == '已认证') {
|
|
if (item.authenticationStatus == '已认证') {
|
|
- uni.showLoading({
|
|
|
|
- title: '加载中'
|
|
|
|
- })
|
|
|
|
- that.$api.doRequest('post', '/searchRecordsInfo/api/addInfo', {
|
|
|
|
- commonId: that.userInfo.id,
|
|
|
|
- searchContent: item.customerName + '(' + item.customerPhone + ')',
|
|
|
|
- functionType: 3
|
|
|
|
- }).then(res => {
|
|
|
|
-
|
|
|
|
- uni.setStorageSync('checkcustomer', item)
|
|
|
|
- that.$api.doRequest('get', '/qualityInspectionManagement/api/settledCount', {
|
|
|
|
- compId: '',
|
|
|
|
- customerName: item.customerName,
|
|
|
|
- goodsName: uni.getStorageSync('goodsName'),
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.data.code == 200) {
|
|
|
|
- count = res.data.data
|
|
|
|
- that.$api.doRequest('get', '/paymentManagement/cumulant', {
|
|
|
|
- compId: '',
|
|
|
|
- customerName: item.customerName,
|
|
|
|
- goodsName: uni.getStorageSync('goodsName'),
|
|
|
|
- }).then(res => {
|
|
|
|
- for (let i = 0; i < that.purchasePriceList.length; i++) {
|
|
|
|
- var data = res.data.data / 1000
|
|
|
|
- if (that.purchasePriceList[i].goodsName == uni
|
|
|
|
- .getStorageSync('goodsName')) {
|
|
|
|
- if (that.purchasePriceList[i].saleLimit - data < 50 ||
|
|
|
|
- count > 0) {
|
|
|
|
- that.$api.msg(
|
|
|
|
- `当前客户已累计销售我司${uni.getStorageSync('goodsName')}${data.toFixed(2)}吨,最高可售${that.purchasePriceList[i].saleLimit}吨。`
|
|
|
|
- )
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- that.show = false
|
|
|
|
- uni.hideLoading()
|
|
|
|
- uni.navigateBack()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- .catch(res => {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '系统异常,请联系管理员',
|
|
|
|
- icon: 'none',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
- uni.hideLoading()
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ // uni.showLoading({
|
|
|
|
+ // title: '加载中'
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+ uni.setStorageSync('checkcustomer', item)
|
|
|
|
+ if (this.recentCustomers.length == 0) {
|
|
|
|
+ this.recentCustomers.push(item)
|
|
|
|
+ uni.setStorageSync('recentCustomers', this.recentCustomers)
|
|
|
|
+ }else{
|
|
|
|
+ let _copyList = this.$u.deepClone(this.recentCustomers);
|
|
|
|
+ for (let i = 0; i < this.recentCustomers.length; i++) {
|
|
|
|
+ if (this.recentCustomers[i].customerPhone != item.customerPhone) {
|
|
|
|
+ _copyList.push(item)
|
|
|
|
+ uni.setStorageSync('recentCustomers', _copyList)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // uni.hideLoading()
|
|
|
|
+ uni.navigateBack()
|
|
|
|
+ // that.$api.doRequest('post', '/searchRecordsInfo/api/addInfo', {
|
|
|
|
+ // commonId: that.userInfo.id,
|
|
|
|
+ // searchContent: item.customerName + '(' + item.customerPhone + ')',
|
|
|
|
+ // functionType: 3
|
|
|
|
+ // }).then(res => {
|
|
|
|
+
|
|
|
|
+ // uni.setStorageSync('checkcustomer', item)
|
|
|
|
+ // that.$api.doRequest('get', '/qualityInspectionManagement/api/settledCount', {
|
|
|
|
+ // compId: '',
|
|
|
|
+ // customerName: item.customerName,
|
|
|
|
+ // goodsName: uni.getStorageSync('goodsName'),
|
|
|
|
+ // }).then(res => {
|
|
|
|
+ // if (res.data.code == 200) {
|
|
|
|
+ // count = res.data.data
|
|
|
|
+ // that.$api.doRequest('get', '/paymentManagement/cumulant', {
|
|
|
|
+ // compId: '',
|
|
|
|
+ // customerName: item.customerName,
|
|
|
|
+ // goodsName: uni.getStorageSync('goodsName'),
|
|
|
|
+ // }).then(res => {
|
|
|
|
+ // for (let i = 0; i < that.purchasePriceList.length; i++) {
|
|
|
|
+ // var data = res.data.data / 1000
|
|
|
|
+ // if (that.purchasePriceList[i].goodsName == uni
|
|
|
|
+ // .getStorageSync('goodsName')) {
|
|
|
|
+ // if (that.purchasePriceList[i].saleLimit - data < 50 ||
|
|
|
|
+ // count > 0) {
|
|
|
|
+ // that.$api.msg(
|
|
|
|
+ // `当前客户已累计销售我司${uni.getStorageSync('goodsName')}${data.toFixed(2)}吨,最高可售${that.purchasePriceList[i].saleLimit}吨。`
|
|
|
|
+ // )
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // that.show = false
|
|
|
|
+ // uni.hideLoading()
|
|
|
|
+ // uni.navigateBack()
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // })
|
|
|
|
+ // .catch(res => {
|
|
|
|
+ // uni.showToast({
|
|
|
|
+ // title: '系统异常,请联系管理员',
|
|
|
|
+ // icon: 'none',
|
|
|
|
+ // duration: 2000
|
|
|
|
+ // })
|
|
|
|
+ // uni.hideLoading()
|
|
|
|
+ // })
|
|
} else {
|
|
} else {
|
|
this.$api.msg('客户身份不可用')
|
|
this.$api.msg('客户身份不可用')
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
recentcustomer(item) {
|
|
recentcustomer(item) {
|
|
- var count = ''
|
|
|
|
- var that = this
|
|
|
|
- var name = item.searchContent.split('(')[0]
|
|
|
|
- var phone = item.searchContent.split('(')[1]
|
|
|
|
- phone = phone.substring(0, phone.length - 1)
|
|
|
|
- for (var i = 0; i < this.customerList.length; i++) {
|
|
|
|
- // console.log(name,this.customerList[i].customerName,name==this.customerList[i].customerName)
|
|
|
|
- if (this.customerList[i].customerPhone == phone) {
|
|
|
|
- var tmpName = this.customerList[i].customerName
|
|
|
|
- uni.setStorageSync('checkcustomer', this.customerList[i])
|
|
|
|
- uni.showLoading({
|
|
|
|
- title: '加载中'
|
|
|
|
- })
|
|
|
|
- that.$api.doRequest('post', '/searchRecordsInfo/api/addInfo', {
|
|
|
|
- commonId: that.userInfo.id,
|
|
|
|
- searchContent: this.customerList[i].customerName + '(' + this.customerList[i]
|
|
|
|
- .customerPhone + ')',
|
|
|
|
- functionType: 3
|
|
|
|
- }).then(res => {
|
|
|
|
- that.$api.doRequest('get', '/qualityInspectionManagement/api/settledCount', {
|
|
|
|
- compId: '',
|
|
|
|
- customerName: tmpName,
|
|
|
|
- goodsName: uni.getStorageSync('goodsName'),
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.data.code == 200) {
|
|
|
|
- count = res.data.data
|
|
|
|
- that.$api.doRequest('get', '/paymentManagement/cumulant', {
|
|
|
|
- compId: '',
|
|
|
|
- customerName: tmpName,
|
|
|
|
- goodsName: uni.getStorageSync('goodsName'),
|
|
|
|
- }).then(res => {
|
|
|
|
- for (let i = 0; i < that.purchasePriceList.length; i++) {
|
|
|
|
- if (that.purchasePriceList[i].goodsName == uni
|
|
|
|
- .getStorageSync('goodsName')) {
|
|
|
|
- var data = res.data.data / 1000
|
|
|
|
- if (that.purchasePriceList[i].saleLimit - data <
|
|
|
|
- 50 || count > 0) {
|
|
|
|
- that.$api.msg(
|
|
|
|
- `当前客户已累计销售我司${uni.getStorageSync('goodsName')}${data.toFixed(2)}吨,最高可售${that.purchasePriceList[i].saleLimit}吨。`
|
|
|
|
- )
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- that.show = false
|
|
|
|
- uni.hideLoading()
|
|
|
|
- uni.navigateBack()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- .catch(res => {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '系统异常,请联系管理员',
|
|
|
|
- icon: 'none',
|
|
|
|
- duration: 2000
|
|
|
|
- })
|
|
|
|
- uni.hideLoading()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ uni.setStorageSync('checkcustomer', item)
|
|
|
|
+ uni.navigateBack()
|
|
|
|
+ // var count = ''
|
|
|
|
+ // var that = this
|
|
|
|
+ // var name = item.searchContent.split('(')[0]
|
|
|
|
+ // var phone = item.searchContent.split('(')[1]
|
|
|
|
+ // phone = phone.substring(0, phone.length - 1)
|
|
|
|
+ // for (var i = 0; i < this.customerList.length; i++) {
|
|
|
|
+ // // console.log(name,this.customerList[i].customerName,name==this.customerList[i].customerName)
|
|
|
|
+ // if (this.customerList[i].customerPhone == phone) {
|
|
|
|
+ // var tmpName = this.customerList[i].customerName
|
|
|
|
+ // uni.setStorageSync('checkcustomer', this.customerList[i])
|
|
|
|
+ // uni.showLoading({
|
|
|
|
+ // title: '加载中'
|
|
|
|
+ // })
|
|
|
|
+ // that.$api.doRequest('post', '/searchRecordsInfo/api/addInfo', {
|
|
|
|
+ // commonId: that.userInfo.id,
|
|
|
|
+ // searchContent: this.customerList[i].customerName + '(' + this.customerList[i]
|
|
|
|
+ // .customerPhone + ')',
|
|
|
|
+ // functionType: 3
|
|
|
|
+ // }).then(res => {
|
|
|
|
+ // that.$api.doRequest('get', '/qualityInspectionManagement/api/settledCount', {
|
|
|
|
+ // compId: '',
|
|
|
|
+ // customerName: tmpName,
|
|
|
|
+ // goodsName: uni.getStorageSync('goodsName'),
|
|
|
|
+ // }).then(res => {
|
|
|
|
+ // if (res.data.code == 200) {
|
|
|
|
+ // count = res.data.data
|
|
|
|
+ // that.$api.doRequest('get', '/paymentManagement/cumulant', {
|
|
|
|
+ // compId: '',
|
|
|
|
+ // customerName: tmpName,
|
|
|
|
+ // goodsName: uni.getStorageSync('goodsName'),
|
|
|
|
+ // }).then(res => {
|
|
|
|
+ // for (let i = 0; i < that.purchasePriceList.length; i++) {
|
|
|
|
+ // if (that.purchasePriceList[i].goodsName == uni
|
|
|
|
+ // .getStorageSync('goodsName')) {
|
|
|
|
+ // var data = res.data.data / 1000
|
|
|
|
+ // if (that.purchasePriceList[i].saleLimit - data <
|
|
|
|
+ // 50 || count > 0) {
|
|
|
|
+ // that.$api.msg(
|
|
|
|
+ // `当前客户已累计销售我司${uni.getStorageSync('goodsName')}${data.toFixed(2)}吨,最高可售${that.purchasePriceList[i].saleLimit}吨。`
|
|
|
|
+ // )
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // that.show = false
|
|
|
|
+ // uni.hideLoading()
|
|
|
|
+ // uni.navigateBack()
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // })
|
|
|
|
+ // .catch(res => {
|
|
|
|
+ // uni.showToast({
|
|
|
|
+ // title: '系统异常,请联系管理员',
|
|
|
|
+ // icon: 'none',
|
|
|
|
+ // duration: 2000
|
|
|
|
+ // })
|
|
|
|
+ // uni.hideLoading()
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
emptysearch() {
|
|
emptysearch() {
|
|
this.show = false
|
|
this.show = false
|
|
@@ -925,15 +997,35 @@
|
|
border-radius: 30px;
|
|
border-radius: 30px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .content1{
|
|
|
|
|
|
+
|
|
|
|
+ .content1 {
|
|
margin-top: 20rpx;
|
|
margin-top: 20rpx;
|
|
padding: 20rpx 0;
|
|
padding: 20rpx 0;
|
|
- .row{
|
|
|
|
|
|
+
|
|
|
|
+ .row {
|
|
display: flex;
|
|
display: flex;
|
|
- padding:20rpx 30rpx;
|
|
|
|
- .row-item{
|
|
|
|
|
|
+ padding: 20rpx 30rpx;
|
|
|
|
+
|
|
|
|
+ .row-item {
|
|
margin-right: 20rpx;
|
|
margin-right: 20rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .dj-customer {
|
|
|
|
+ background: #F5F6F9;
|
|
|
|
+ display: flex;
|
|
|
|
+ width: 60%;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin: 20rpx;
|
|
|
|
+ border-radius: 30rpx;
|
|
|
|
+ padding: 10rpx 20rpx;
|
|
|
|
+
|
|
|
|
+ .right {
|
|
|
|
+ display: flex;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|