|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="content">
|
|
|
-<!-- <view class="content1">
|
|
|
+ <!-- <view class="content1">
|
|
|
<view style='width:70px'>付款方式</view>
|
|
|
<u-radio-group v-model="dataDetails.advanceFreightService" placement="row">
|
|
|
<u-radio :customStyle="radioCustomStyle" v-for="(item, index) in radiolist1" :key="index"
|
|
@@ -37,12 +37,68 @@
|
|
|
<view class="gray">距离</view>
|
|
|
<view class="">约{{dataDetails.distance}}公里</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <view class="title">
|
|
|
+ 完善信息
|
|
|
+ </view>
|
|
|
<view class='row-between'>
|
|
|
<view class="gray">运费</view>
|
|
|
- <view class="">{{dataDetails.freight}}{{dataDetails.illingMethod==0?'元/吨':'元/车'}}</view>
|
|
|
+ <!-- <view class="">{{dataDetails.freight}}{{dataDetails.illingMethod==0?'元/吨':'元/车'}}</view> -->
|
|
|
<!-- <view class="flex"><input type="text" placeholder="请输入运费" v-model="dataDetails.freight"
|
|
|
class="text-align-right yf-input">{{dataDetails.freight}}元/车</view> -->
|
|
|
+ <view class="flex">
|
|
|
+ <u--input placeholder="请输入运费" border="none" type="number" v-model="dataDetails.freightCars" inputAlign='right'
|
|
|
+ clearable></u--input>
|
|
|
+ <!-- <span>元/车</span> -->
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class='row-between'>
|
|
|
+ <view class="gray">挂车号(选填)</view>
|
|
|
+ <view class="">
|
|
|
+ <u--input placeholder="请输入挂车号" border="none" v-model="dataDetails.trailerNumber" inputAlign='right'
|
|
|
+ clearable></u--input>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class='row-between'>
|
|
|
+ <view class="gray">运输开始日期</view>
|
|
|
+ <view class="">
|
|
|
+ <view @click="dateShow">{{dataDetails.startDates?dataDetails.startDates:'请选择运输开始日期'}}
|
|
|
+ </view>
|
|
|
+ <u-datetime-picker :show="startShow" mode="date"
|
|
|
+ @cancel="removeStart" @confirm="startDate" @close="removeStart"></u-datetime-picker>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class='row-between'>
|
|
|
+ <view class="gray">运输截止日期</view>
|
|
|
+ <view class="">
|
|
|
+ <!-- <u--input placeholder="请输入内容" border="none" v-model="dataDetails.value" inputAlign='right'
|
|
|
+ clearable></u--input> -->
|
|
|
+ <view class="" @click="endShow = true">{{dataDetails.endDates?dataDetails.endDates:'请选择运输截止日期'}}</view>
|
|
|
+ <u-datetime-picker :show="endShow" mode="date" @cancel="removeEnd" @confirm="endDate" @close="removeEnd"></u-datetime-picker>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class='row-between'>
|
|
|
+ <view class="gray">联络人姓名</view>
|
|
|
+ <view class="">
|
|
|
+ <u--input placeholder="请输入联络人姓名" border="none" v-model="dataDetails.contactPersonName" inputAlign='right'
|
|
|
+ clearable></u--input>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+ <view class='row-between'>
|
|
|
+ <view class="gray">联络人电话</view>
|
|
|
+ <view class="">
|
|
|
+ <u--input placeholder="请输入联络人电话" border="none" type="number" maxlength="11" v-model="dataDetails.contactPersonPhone" inputAlign='right'
|
|
|
+ clearable></u--input>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class='row-between'>
|
|
|
+ <view class="gray">装车后预付款</view>
|
|
|
+ <view class="">
|
|
|
+ <u--input placeholder="请输入装车后预付款" border="none" v-model="dataDetails.advanceCharge" inputAlign='right'
|
|
|
+ clearable></u--input>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
<view class="wrapper content3">
|
|
|
<view class="qm-row">
|
|
@@ -87,7 +143,7 @@
|
|
|
margin: '0 0 0 10rpx'
|
|
|
},
|
|
|
canvasName: 'handWriting',
|
|
|
- ctx: '',
|
|
|
+ ctx: "",
|
|
|
startX: null,
|
|
|
startY: null,
|
|
|
canvasWidth: 0,
|
|
@@ -106,12 +162,17 @@
|
|
|
disabled: false
|
|
|
},
|
|
|
],
|
|
|
+ startShow: false,
|
|
|
+ endShow:false,
|
|
|
+
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
that = this
|
|
|
- console.log(options)
|
|
|
- this.dataDetails =JSON.parse(options.obj)
|
|
|
+ console.log(JSON.parse(options.obj))
|
|
|
+ // this.dataDetails = JSON.parse(options.obj)
|
|
|
+ this.dataDetails = JSON.parse(decodeURIComponent(options.obj))
|
|
|
this.dataDetails.advanceFreightService = '平台垫付运费'
|
|
|
this.ctx = uni.createCanvasContext("handWriting");
|
|
|
this.$nextTick(() => {
|
|
@@ -125,6 +186,25 @@
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ dateShow(){
|
|
|
+ this.startShow = true
|
|
|
+ },
|
|
|
+ removeStart(){
|
|
|
+ this.startShow = false
|
|
|
+ },
|
|
|
+ removeEnd(){
|
|
|
+ this.endShow = false
|
|
|
+ },
|
|
|
+ startDate(e) {
|
|
|
+ let timeFormat = uni.$u.timeFormat
|
|
|
+ this.dataDetails.startDates = timeFormat(e.value,"yyyy-mm-dd")
|
|
|
+ this.startShow = false
|
|
|
+ },
|
|
|
+ endDate(e){
|
|
|
+ let timeFormat = uni.$u.timeFormat
|
|
|
+ this.dataDetails.endDates = timeFormat(e.value,"yyyy-mm-dd")
|
|
|
+ this.endShow = false
|
|
|
+ },
|
|
|
submit() {
|
|
|
if (!that.isScaleStart) {
|
|
|
that.$refs.uToast.show({
|
|
@@ -133,13 +213,59 @@
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- // if (uni.$u.test.isEmpty(that.dataDetails.freight)) {
|
|
|
- // that.$refs.uToast.show({
|
|
|
- // type: 'error',
|
|
|
- // message: "运费不能为空!",
|
|
|
- // })
|
|
|
- // return
|
|
|
- // }
|
|
|
+ if (uni.$u.test.isEmpty(that.dataDetails.freightCars)) {
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "运费不能为空!",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(that.dataDetails.startDates)) {
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "运输起始日期不能为空!",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(that.dataDetails.endDates)) {
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "运输截止日期不能为空!",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(that.dataDetails.contactPersonName)) {
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "联络人姓名不能为空!",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(that.dataDetails.contactPersonPhone)) {
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "联络人电话不能为空!",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(that.dataDetails.advanceCharge)) {
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "装车后预付款不能为空!",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.log(that.dataDetails)
|
|
|
+ let _obj = {}
|
|
|
+ _obj.trailerNumber = that.dataDetails.trailerNumber
|
|
|
+ _obj.startDates = that.dataDetails.startDates
|
|
|
+ _obj.endDates = that.dataDetails.endDates
|
|
|
+ _obj.contactPersonName = that.dataDetails.contactPersonName
|
|
|
+ _obj.contactPersonPhone = that.dataDetails.contactPersonPhone
|
|
|
+ _obj.freightCars = that.dataDetails.freightCars
|
|
|
+ _obj.advanceCharge = that.dataDetails.advanceCharge
|
|
|
+ _obj.id = that.dataDetails.id
|
|
|
+
|
|
|
uni.canvasToTempFilePath({
|
|
|
canvasId: 'handWriting',
|
|
|
fileType: 'png',
|
|
@@ -149,44 +275,42 @@
|
|
|
uploadImage('image', res.tempFilePath, 'appData/',
|
|
|
result => {
|
|
|
// 上传成功
|
|
|
- console.log('图片地址', result)
|
|
|
that.dataDetails.cargoOwnerAutograph = result
|
|
|
-
|
|
|
-
|
|
|
+ _obj.driverAutograph = result
|
|
|
uni.showLoading({
|
|
|
title: '加载中',
|
|
|
mask: true
|
|
|
})
|
|
|
-
|
|
|
- that.$request.baseRequest('get', '/orderInfo/setPdf', that.dataDetails).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- // that.contractSrc = res.data
|
|
|
- // uni.downloadFile({
|
|
|
- // url: res.data,
|
|
|
- // success: function(res) {
|
|
|
- // var filePath = res.tempFilePath;
|
|
|
- // uni.openDocument({
|
|
|
- // filePath: filePath,
|
|
|
- // showMenu: true,
|
|
|
- // success: function(res) {
|
|
|
- // console.log('打开文档成功');
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
- // });
|
|
|
- // this.$refs.uToast.show({
|
|
|
- // type: 'success',
|
|
|
- // message: "提交成功",
|
|
|
- // complete() {
|
|
|
- // that.upCallback({
|
|
|
- // size: 10,
|
|
|
- // num: 1
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
+ that.$request.baseRequest('get', '/orderInfo/setPdf', _obj).then(
|
|
|
+ res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ uni.hideLoading()
|
|
|
+ that.contractSrc = res.data
|
|
|
+ uni.downloadFile({
|
|
|
+ url: res.data,
|
|
|
+ success: function(res) {
|
|
|
+ var filePath = res.tempFilePath;
|
|
|
+ uni.openDocument({
|
|
|
+ filePath: filePath,
|
|
|
+ showMenu: true,
|
|
|
+ success: function(res) {
|
|
|
+ console.log('打开文档成功');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ that.$refs.uToast.show({
|
|
|
+ type: 'success',
|
|
|
+ message: "提交成功",
|
|
|
+ complete() {
|
|
|
+ that.upCallback({
|
|
|
+ size: 10,
|
|
|
+ num: 1
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
.catch(res => {
|
|
|
uni.$u.toast(res.message);
|
|
|
});
|