|
@@ -3,6 +3,7 @@ package com.quansu.heifengwuliu.fragment
|
|
import android.app.Activity
|
|
import android.app.Activity
|
|
import android.content.Intent
|
|
import android.content.Intent
|
|
import android.os.Bundle
|
|
import android.os.Bundle
|
|
|
|
+import android.text.Editable
|
|
import android.text.TextUtils
|
|
import android.text.TextUtils
|
|
import android.util.Log
|
|
import android.util.Log
|
|
import android.view.LayoutInflater
|
|
import android.view.LayoutInflater
|
|
@@ -30,6 +31,8 @@ import com.quansu.heifengwuliu.model.bean.SendBean
|
|
import com.quansu.heifengwuliu.utils.PopuAllCarsUtils
|
|
import com.quansu.heifengwuliu.utils.PopuAllCarsUtils
|
|
import com.quansu.heifengwuliu.utils.PopuListUtils
|
|
import com.quansu.heifengwuliu.utils.PopuListUtils
|
|
import com.quansu.heifengwuliu.utils.PopupUtils
|
|
import com.quansu.heifengwuliu.utils.PopupUtils
|
|
|
|
+import com.quansu.heifengwuliu.utils.VerifyUtils
|
|
|
|
+import com.quansu.heifengwuliu.view.SimpleTextWatcher
|
|
import com.quansu.heifengwuliu.vmodel.OwnerMoreVModel
|
|
import com.quansu.heifengwuliu.vmodel.OwnerMoreVModel
|
|
import com.ysnows.base.model.PositionBean
|
|
import com.ysnows.base.model.PositionBean
|
|
import com.ysnows.base.utils.B
|
|
import com.ysnows.base.utils.B
|
|
@@ -155,9 +158,29 @@ class OwnerMoreFragment : MBFragment<OwnerMoreVModel, FragmentOwnermoreBinding>(
|
|
UiSwitch.singleRes(this, CollectionActivity::class.java, MIntentAction.REQUEST_CODE_THREE)
|
|
UiSwitch.singleRes(this, CollectionActivity::class.java, MIntentAction.REQUEST_CODE_THREE)
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ binding.viewHead.getEtName()!!.addTextChangedListener(textWatcher)
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ var oldNmae:String=""
|
|
|
|
+
|
|
|
|
+ var textWatcher= object: SimpleTextWatcher(){
|
|
|
|
+ override fun afterTextChanged(s: Editable?) {
|
|
|
|
+ super.afterTextChanged(s)
|
|
|
|
+
|
|
|
|
+ var name=s.toString()
|
|
|
|
+ if(!TextUtils.isEmpty(oldNmae)&& oldNmae == name){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(!TextUtils.isEmpty(name)) {
|
|
|
|
+ if (!VerifyUtils.isLegalName(name)) {
|
|
|
|
+ toast("装货人姓名格式不对!!")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private fun judgeValue() {
|
|
private fun judgeValue() {
|
|
|
|
|
|
var type_id = binding.viewHead.type_id
|
|
var type_id = binding.viewHead.type_id
|
|
@@ -175,6 +198,11 @@ class OwnerMoreFragment : MBFragment<OwnerMoreVModel, FragmentOwnermoreBinding>(
|
|
toast("请输入发货人!")
|
|
toast("请输入发货人!")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(!VerifyUtils.isLegalName(name_out)){
|
|
|
|
+ toast("卸货人姓名格式不对,请检查!")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
var mobile_out = binding.viewHead.getEtPhone()!!.text.toString().trim()
|
|
var mobile_out = binding.viewHead.getEtPhone()!!.text.toString().trim()
|
|
if (TextUtils.isEmpty(mobile_out)) {
|
|
if (TextUtils.isEmpty(mobile_out)) {
|
|
toast("请输入发货人电话!")
|
|
toast("请输入发货人电话!")
|
|
@@ -196,6 +224,10 @@ class OwnerMoreFragment : MBFragment<OwnerMoreVModel, FragmentOwnermoreBinding>(
|
|
toast("请输入卸货人!")
|
|
toast("请输入卸货人!")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ if(!VerifyUtils.isLegalName(item.name)){
|
|
|
|
+ toast("卸货人姓名格式不对,请检查!")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
if (TextUtils.isEmpty(item.mobile)) {
|
|
if (TextUtils.isEmpty(item.mobile)) {
|
|
toast("请输入卸货人电话!")
|
|
toast("请输入卸货人电话!")
|
|
return
|
|
return
|
|
@@ -369,7 +401,17 @@ class OwnerMoreFragment : MBFragment<OwnerMoreVModel, FragmentOwnermoreBinding>(
|
|
4->list[pos].name=str.toString()
|
|
4->list[pos].name=str.toString()
|
|
5->list[pos].mobile=str.toString()
|
|
5->list[pos].mobile=str.toString()
|
|
6->list[pos].address=str.toString()
|
|
6->list[pos].address=str.toString()
|
|
- 7->list[pos].goods=str.toString()
|
|
|
|
|
|
+ 7->{
|
|
|
|
+ if(!TextUtils.isEmpty(str)){
|
|
|
|
+
|
|
|
|
+ if(!VerifyUtils.isLegalName(str!!)){
|
|
|
|
+ toast("卸货人姓名格式不对!!")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ list[pos].goods=str.toString()
|
|
|
|
+ }
|
|
else -> ""
|
|
else -> ""
|
|
}
|
|
}
|
|
|
|
|