|
@@ -145,45 +145,54 @@
|
|
|
|
|
|
},
|
|
|
checkcustomer(item){
|
|
|
+ debugger
|
|
|
var that = this
|
|
|
var count=''
|
|
|
- uni.showLoading({title: '加载中',mask:true})
|
|
|
+
|
|
|
if(item.authenticationStatus=='已认证'){
|
|
|
-
|
|
|
- this.$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'),
|
|
|
+ uni.showLoading({title: '加载中'})
|
|
|
+ that.$api.doRequest('post', '/searchRecordsInfo/api/addInfo',{
|
|
|
+ commonId:that.userInfo.id,
|
|
|
+ searchContent:item.customerName+'('+item.customerPhone+')',
|
|
|
+ functionType:3
|
|
|
}).then(res => {
|
|
|
- for (let i = 0; i < this.purchasePriceList.length; i++) {
|
|
|
- var data = res.data.data/1000
|
|
|
- if(this.purchasePriceList[i].goodsName== uni.getStorageSync('goodsName')){
|
|
|
- if(this.purchasePriceList[i].saleLimit - data < 50 || count > 0){
|
|
|
- this.$api.msg(`当前客户已累计销售我司${uni.getStorageSync('goodsName')}${data}吨,最高可售${this.purchasePriceList[i].saleLimit}吨。`)
|
|
|
- }else{
|
|
|
- that.$api.doRequest('post', '/searchRecordsInfo/api/addInfo',{
|
|
|
- commonId:that.userInfo.id,
|
|
|
- searchContent:item.customerName+'('+item.customerPhone+')',
|
|
|
- functionType:3
|
|
|
- }).then(res => {
|
|
|
- uni.hideLoading()
|
|
|
- uni.setStorageSync('checkcustomer',item)
|
|
|
- uni.navigateBack()
|
|
|
- })
|
|
|
- }
|
|
|
+ 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 => {
|
|
|
+ uni.hideLoading()
|
|
|
+ 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}吨。`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- }
|
|
|
+ })
|
|
|
+ uni.setStorageSync('checkcustomer',item)
|
|
|
+ uni.navigateBack()
|
|
|
})
|
|
|
+ .catch(res => {
|
|
|
+ uni.showToast({
|
|
|
+ title: '系统异常,请联系管理员',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}else{
|
|
|
this.$api.msg('客户身份不可用')
|
|
@@ -198,42 +207,47 @@
|
|
|
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].customerName==name){
|
|
|
- uni.showLoading({title: '加载中',mask:true})
|
|
|
- this.$api.doRequest('get', '/qualityInspectionManagement/api/settledCount',{
|
|
|
+ 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 => {
|
|
|
+ uni.setStorageSync('checkcustomer',this.customerList[i])
|
|
|
+ that.$api.doRequest('get', '/qualityInspectionManagement/api/settledCount',{
|
|
|
compId:'',
|
|
|
- customerName: this.customerList[i].customerName,
|
|
|
+ customerName: that.customerList[i].customerName,
|
|
|
goodsName: uni.getStorageSync('goodsName'),
|
|
|
}).then(res => {
|
|
|
if(res.data.code==200){
|
|
|
count=res.data.data
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- that.$api.doRequest('get', '/paymentManagement/cumulant',{
|
|
|
- compId:'',
|
|
|
- customerName: this.customerList[i].customerName,
|
|
|
- goodsName: uni.getStorageSync('goodsName'),
|
|
|
- }).then(res => {
|
|
|
- for (let i = 0; i < this.purchasePriceList.length; i++) {
|
|
|
- if(this.purchasePriceList[i].goodsName== uni.getStorageSync('goodsName')){
|
|
|
- var data = res.data.data/1000
|
|
|
- if(this.purchasePriceList[i].saleLimit - data < 50 || count > 0){
|
|
|
- this.$api.msg(`当前客户已累计销售我司${uni.getStorageSync('goodsName')}${data}吨,最高可售${this.purchasePriceList[i].saleLimit}吨。`)
|
|
|
- }else{
|
|
|
- that.$api.doRequest('post', '/searchRecordsInfo/api/addInfo',{
|
|
|
- commonId:that.userInfo.id,
|
|
|
- searchContent:this.customerList[i].customerName+'('+this.customerList[i].customerPhone+')',
|
|
|
- functionType:3
|
|
|
- }).then(res => {
|
|
|
- uni.hideLoading()
|
|
|
- uni.setStorageSync('checkcustomer',this.customerList[i])
|
|
|
- uni.navigateBack()
|
|
|
- })
|
|
|
+ that.$api.doRequest('get', '/paymentManagement/cumulant',{
|
|
|
+ compId:'',
|
|
|
+ customerName: that.customerList[i].customerName,
|
|
|
+ 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}吨。`)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+ uni.navigateBack()
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ uni.showToast({
|
|
|
+ title: '系统异常,请联系管理员',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
},
|