|
@@ -11,7 +11,7 @@
|
|
|
</view>
|
|
|
<view class="cu-form-group">
|
|
|
<view class="title">司机手机号</view>
|
|
|
- <input placeholder="请输入司机身份认证的手机号" name="input" v-model="goods.driverPhone"></input>
|
|
|
+ <input maxlength='11' placeholder="请输入司机身份认证的手机号" name="input" v-model="goods.driverPhone"></input>
|
|
|
</view>
|
|
|
<view class="cu-form-group">
|
|
|
<view class="title">毛重(吨)</view>
|
|
@@ -27,11 +27,8 @@
|
|
|
</view>
|
|
|
<view class="cu-form-group">
|
|
|
<view class="title">发货日期</view>
|
|
|
- <picker mode="date" :start="startDate" :end="endDate" :value="goods.sendDateStart" @change="DateChange">
|
|
|
- <view class="picker">
|
|
|
- {{goods.sendDateStart}}
|
|
|
- </view>
|
|
|
- </picker>
|
|
|
+ <view @click="show = true">{{goods.sendDateStart!=''?goods.sendDateStart:time}}</view>
|
|
|
+ <u-picker :params='params' :default-time='time' @confirm="DateChange" v-model="show" mode="time"></u-picker>
|
|
|
</view>
|
|
|
<view class="cu-bar bg-white margin-top">
|
|
|
<view class="action">
|
|
@@ -76,9 +73,14 @@
|
|
|
loadPoundImg:'',
|
|
|
contractNo:'',
|
|
|
goodsName:'',
|
|
|
- sendDateStart:'请选择'
|
|
|
+ sendDateStart:''
|
|
|
|
|
|
},
|
|
|
+ params:{
|
|
|
+ year: true,
|
|
|
+ month: true,
|
|
|
+ day: true,
|
|
|
+ },
|
|
|
carNo:'',
|
|
|
PageCur: "trust",
|
|
|
TabCur: 0,
|
|
@@ -92,6 +94,7 @@
|
|
|
exsitCount:0,
|
|
|
origin:'',
|
|
|
stock:'',
|
|
|
+ show:false,
|
|
|
goodsName:'',
|
|
|
verifyCode:'',
|
|
|
sendText0:'获取验证码',
|
|
@@ -121,11 +124,22 @@
|
|
|
driverNoImg1:'',
|
|
|
carNoImg:'',
|
|
|
carNoImg1:'',
|
|
|
+ goodsName:'',
|
|
|
showTran:true
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['hasLogin','userInfo']),
|
|
|
+ time() {
|
|
|
+ var date=new Date()
|
|
|
+ var year=date.getFullYear()
|
|
|
+ var month=date.getMonth()
|
|
|
+ var date1=date.getDate()
|
|
|
+ if(month+1<10){
|
|
|
+ month="0"+(month+1)
|
|
|
+ }
|
|
|
+ return year+'-'+month+"-"+date1
|
|
|
+ },
|
|
|
startDate() {
|
|
|
//限制开始时间;
|
|
|
//也可以直接限定为当天日期 var date= new Date(); return date
|
|
@@ -138,6 +152,8 @@
|
|
|
onShow() {
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
+ this.goodsName=option.goodsName
|
|
|
+ this.contractNo = option.contractNo
|
|
|
this.goods.goodsName=option.goodsName
|
|
|
this.goods.contractNo = option.contractNo
|
|
|
this.goods.tranCarNo=option.tranCarNo
|
|
@@ -145,7 +161,8 @@
|
|
|
},
|
|
|
methods: {
|
|
|
DateChange(e) {
|
|
|
- this.goods.sendDateStart = e.detail.value
|
|
|
+ this.goods.sendDateStart=e.year+'-'+e.month+'-'+e.day
|
|
|
+ // this.goods.sendDateStart = e.detail.value
|
|
|
},
|
|
|
commit1(item){
|
|
|
uni.navigateTo({
|
|
@@ -199,30 +216,65 @@
|
|
|
this.$api.msg('皮重输入错误')
|
|
|
return
|
|
|
}
|
|
|
- this.$api.doRequest('post','/tranCarInfo/api/addTranTask',this.goods).then(res => {
|
|
|
- if(res.data.code==200){
|
|
|
- uni.showToast({
|
|
|
- title: '添加发车信息成功',
|
|
|
- icon:'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- uni.navigateBack();
|
|
|
- }else if(res.data.code==11015){
|
|
|
- uni.showToast({
|
|
|
- title: '该司机未认证身份,请司机认证后再操作',
|
|
|
- icon:'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
- uni.showToast({
|
|
|
- title: res.errmsg,
|
|
|
- icon:'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- });
|
|
|
- },
|
|
|
+ var that=this
|
|
|
+ uni.showModal({
|
|
|
+ content: '确定提交发车信息?',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ that.$api.doRequest('post','/tranCarInfo/api/addTranTask',that.goods).then(res => {
|
|
|
+ if(res.data.code==200){
|
|
|
+ console.log(that.goods)
|
|
|
+ uni.showModal({
|
|
|
+ content: '提交成功!',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ var result = that.goods.tranCarNo.substr(that.goods.tranCarNo.indexOf("C") + 1,that.goods.tranCarNo.length);
|
|
|
+ var num=Number(result)+1
|
|
|
+ if(num<=9){
|
|
|
+ num='C00'+num
|
|
|
+ }else if(num<100&&num>9){
|
|
|
+ num='C0'+num
|
|
|
+ }else if(num<1000&&num>99){
|
|
|
+ num='C'+num
|
|
|
+ }
|
|
|
+ that.goods={
|
|
|
+ tranCarNo:num,
|
|
|
+ carNo:'',
|
|
|
+ grossWeight:'',
|
|
|
+ tare:'',
|
|
|
+ loadNetWeight:'',
|
|
|
+ loadPoundImg:'',
|
|
|
+ contractNo:that.contractNo,
|
|
|
+ goodsName:that.goodsName,
|
|
|
+ sendDateStart:''
|
|
|
+
|
|
|
+ }
|
|
|
+ }else if (res.cancel) {
|
|
|
+ uni.navigateBack();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else if(res.data.code==11015){
|
|
|
+ uni.showToast({
|
|
|
+ title: '该司机未认证身份,请司机认证后再操作',
|
|
|
+ icon:'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.errmsg,
|
|
|
+ icon:'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ });
|
|
|
+ } else if (res.cancel) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
ChooseImagePerson() {
|
|
|
uni.chooseImage({
|
|
|
count: 1, //默认9
|