|
@@ -12,14 +12,14 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="content1">
|
|
|
- <view class="row" @click="selectCargoOwner" v-if="!dataObj.cargoOwner">
|
|
|
- <view class="left select-sf">选择货主身份</view>
|
|
|
+ <view class="row" @click="selectCargoOwner">
|
|
|
+ <view class="left select-sf">{{dataObj.cargoOwner?dataObj.cargoOwner:'选择货主身份'}}</view>
|
|
|
<view class="right">></view>
|
|
|
</view>
|
|
|
- <view class="row" @click="selectCargoOwner" v-if="dataObj.cargoOwner">
|
|
|
+ <!-- <view class="row" @click="selectCargoOwner" v-if="dataObj.cargoOwner">
|
|
|
<view class="left">{{dataObj.cargoOwner}}</view>
|
|
|
<view class="right">></view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<u-picker :show="show" :columns="columns" :closeOnClickOverlay='true' @close='selectCargoOwnerClose'
|
|
|
@cancel='selectCargoOwnerClose' @confirm='confirmSelectCargoOwner'></u-picker>
|
|
|
</view>
|
|
@@ -61,6 +61,7 @@
|
|
|
<view class="row">
|
|
|
<view class="left">距离</view>
|
|
|
<input type="text" value="" class="input" placeholder="自动计算" v-model="dataObj.distance" disabled="" />
|
|
|
+ <view>Km</view>
|
|
|
</view>
|
|
|
<view class="row">
|
|
|
<view class="left">货名</view>
|
|
@@ -69,7 +70,6 @@
|
|
|
</view>
|
|
|
<view class="flex row">
|
|
|
<view class="left-text">运费计算方式</view>
|
|
|
- <!-- <u-radio-group v-model="dataDetails.driverSex" placement="row"> -->
|
|
|
<u-radio-group placement="row" v-model="dataObj.billingMethod" class="select-type">
|
|
|
<u-radio :customStyle="radioCustomStyle" v-for="(item, index) in radiolist1" :key="index"
|
|
|
:label="item.name" :name="item.name" @change="radioChange">
|
|
@@ -78,10 +78,10 @@
|
|
|
</view>
|
|
|
<view class="row">
|
|
|
<view class="left">运费单价</view>
|
|
|
- <view class="right"><input type="text" value="" placeholder="输入运费单价" class="input"
|
|
|
+ <view class="right"><input type="number" value="" placeholder="输入运费单价" class="input"
|
|
|
v-model="dataObj.freightPrice" /></view>
|
|
|
</view>
|
|
|
- <view class="row">
|
|
|
+ <view class="row" v-if="dataObj.freightAdvance">
|
|
|
<view class="left">该任务申请运费垫付</view>
|
|
|
<view class="right">
|
|
|
<u-switch v-model="dataObj.freightAdvance" @change="change" size="20"></u-switch>
|
|
@@ -102,7 +102,8 @@
|
|
|
<view class="row">
|
|
|
<view class="left">发货联系人电话</view>
|
|
|
<view class="right flex">
|
|
|
- <input type="text" value="" placeholder="输入发货联系人手机号" class="input" v-model="dataObj.senderPhone" />
|
|
|
+ <input type="number" maxlength="11" value="" placeholder="输入发货联系人手机号" class="input"
|
|
|
+ v-model="dataObj.senderPhone" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="row">
|
|
@@ -114,14 +115,15 @@
|
|
|
<view class="row">
|
|
|
<view class="left">收货联系人电话</view>
|
|
|
<view class="right flex">
|
|
|
- <input type="text" value="" placeholder="输入收货联系人手机号" class="input"
|
|
|
+ <input type="number" maxlength="11" placeholder="输入收货联系人手机号" class="input"
|
|
|
v-model="dataObj.receiverPhone" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="row">
|
|
|
<view class="left">重量(吨)</view>
|
|
|
<view class="right flex">
|
|
|
- <input type="text" value="" placeholder="输入预计发运重量" class="input" v-model="dataObj.weight" />
|
|
|
+ <input type="text" value="" placeholder="输入预计发运重量" class="number" v-model="dataObj.weight"
|
|
|
+ style="text-align: right;" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="flex row" @click="selectValidityPeriod(0)">
|
|
@@ -141,14 +143,14 @@
|
|
|
</view>
|
|
|
<view class="row flex-space-between row-bgc">
|
|
|
<view class="car-row">
|
|
|
- <input type="text" value="" placeholder="最短不限" class="" v-model="dataObj.carLengthSmall"
|
|
|
+ <input type="number" value="" placeholder="最短不限" class="" v-model="dataObj.carLengthSmall"
|
|
|
class="car-input" />
|
|
|
<view>m</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="car-line">-</view>
|
|
|
<view class="car-row">
|
|
|
- <input type="text" value="" placeholder="最长不限" class="" v-model="dataObj.carLength"
|
|
|
+ <input type="number" value="" placeholder="最长不限" class="" v-model="dataObj.carLength"
|
|
|
class="car-input" />
|
|
|
<view>m</view>
|
|
|
</view>
|
|
@@ -159,13 +161,13 @@
|
|
|
</view>
|
|
|
<view class="row flex-space-between row-bgc">
|
|
|
<view class="car-row">
|
|
|
- <input type="text" value="" placeholder="最小不限" class="car-input"
|
|
|
+ <input type="number" value="" placeholder="最小不限" class="car-input"
|
|
|
v-model="dataObj.loadWeightSmall" />
|
|
|
<view>吨</view>
|
|
|
</view>
|
|
|
<view class="car-line">-</view>
|
|
|
<view class="car-row">
|
|
|
- <input type="text" value="" placeholder="最大不限" class="car-input" v-model="dataObj.loadWeight" />
|
|
|
+ <input type="number" value="" placeholder="最大不限" class="car-input" v-model="dataObj.loadWeight" />
|
|
|
<view>吨</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -183,13 +185,14 @@
|
|
|
<view class="left">任务描述</view>
|
|
|
</view>
|
|
|
<view class="row">
|
|
|
- <u--textarea v-model="dataObj.taskDescription" placeholder="请输入内容"></u--textarea>
|
|
|
+ <u--textarea v-model="dataObj.taskDescription" placeholder="请输入内容" :count='true' maxlength='200'>
|
|
|
+ </u--textarea>
|
|
|
</view>
|
|
|
|
|
|
|
|
|
- <view class="flex row noborder">
|
|
|
+ <view class="flex row noborder" @click="selectValidityPeriodcq">
|
|
|
<view class="left-text">任务有效期</view>
|
|
|
- <view :class="dataObj.taskValidity?'':'select-data'" @click="selectValidityPeriodcq">
|
|
|
+ <view :class="dataObj.taskValidity?'':'select-data'">
|
|
|
{{dataObj.taskValidity?dataObj.taskValidity:'选择任务有效期>'}}
|
|
|
</view>
|
|
|
</view>
|
|
@@ -202,6 +205,9 @@
|
|
|
<u-picker :show="isShowValidity" ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
|
|
|
:closeOnClickOverlay='true' @close='isShowValidity=false' @cancel='isShowValidity=false'>
|
|
|
</u-picker>
|
|
|
+ <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
|
|
|
+ :showCancelButton='true' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
|
|
|
+ @cancel="cancelClick"></u-modal>
|
|
|
<u-toast ref="uToast"></u-toast>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -214,12 +220,16 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ qyList: [],
|
|
|
+ isShowAlert: false,
|
|
|
+ alertTitle: '确定发布运输任务?',
|
|
|
+ alertContent: null,
|
|
|
radioCustomStyle: {
|
|
|
margin: '0 0 0 20rpx'
|
|
|
},
|
|
|
show: false,
|
|
|
columns: [
|
|
|
- ['个人货主', '黑龙江中天昊元贸易有限公司', '黑龙江利润元贸易有限公司']
|
|
|
+ []
|
|
|
],
|
|
|
dataObj: {
|
|
|
commonId: '',
|
|
@@ -280,6 +290,9 @@
|
|
|
validityPeriod: [],
|
|
|
validityPeriodcq: [],
|
|
|
isShowValidity: false,
|
|
|
+ dataDetails: {
|
|
|
+ type: '元/车'
|
|
|
+ },
|
|
|
radiolist1: [{
|
|
|
name: '元/吨',
|
|
|
disabled: false
|
|
@@ -292,29 +305,12 @@
|
|
|
],
|
|
|
}
|
|
|
},
|
|
|
- onShow() {
|
|
|
- // //获取默认收货、发货地
|
|
|
- // let _faddress = uni.getStorageSync('storage_faddress');
|
|
|
- // let _saddress = uni.getStorageSync('storage_saddress');
|
|
|
- // if (_faddress) {
|
|
|
- // this.dataObj.sendCity = _faddress.city
|
|
|
- // this.dataObj.sendArea = _faddress.area
|
|
|
- // this.dataObj.sendPrivate = _faddress.province
|
|
|
- // this.dataObj.sendDetailedAddress = _faddress.detailedAddress
|
|
|
- // this.dataObj.sendLongitude = _faddress.longitude
|
|
|
- // this.dataObj.sendLatitude = _faddress.latitude
|
|
|
- // }
|
|
|
- // if (_saddress) {
|
|
|
- // this.dataObj.unloadDetailedAddress = _saddress.detailedAddress
|
|
|
- // this.dataObj.unloadCity = _saddress.city
|
|
|
- // this.dataObj.unloadArea = _saddress.area
|
|
|
- // this.dataObj.unloadPrivate = _saddress.province
|
|
|
- // this.dataObj.unsendLongitude = _saddress.longitude
|
|
|
- // this.dataObj.unsendLatitude = _saddress.latitude
|
|
|
- // }
|
|
|
+ onShow() {debugger
|
|
|
+ // this.getSFList()
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
-
|
|
|
+
|
|
|
+ _this = this;
|
|
|
_this = this;
|
|
|
this.dataObj = options
|
|
|
if (this.dataObj.billingMethod == 1) {
|
|
@@ -322,9 +318,9 @@
|
|
|
} else {
|
|
|
this.dataObj.billingMethod = '元/吨'
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
for (let i = 0; i < this.dataObj.carModel.length; i++) {
|
|
|
-
|
|
|
+
|
|
|
if (this.dataObj.carModel[i] == '1') {
|
|
|
this.checkboxValue1.push('不限')
|
|
|
} else if (this.dataObj.carModel[i] == '2') {
|
|
@@ -340,16 +336,328 @@
|
|
|
} else {
|
|
|
this.dataObj.freightAdvance = false
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
console.log(this.dataObj)
|
|
|
this.validityPeriod = this.$helper.makeValidityPeriod(0, '随时')
|
|
|
this.validityPeriodcq = this.$helper.makeValidityPeriod(0, '随时')
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['hasLogin', 'userInfo']),
|
|
|
},
|
|
|
methods: {
|
|
|
+ getSFList() {
|
|
|
+ this.dataObj.commonId = this.userInfo.id
|
|
|
+ this.$request.baseRequest('get', '/cargoOwnerCompInfo/cargoOwnerList', {
|
|
|
+ commonId: this.userInfo.id
|
|
|
+ }).then(res => {
|
|
|
+ if (uni.getStorageSync('releaseCargoOwner')) {
|
|
|
+ this.dataObj.cargoOwner = uni.getStorageSync('releaseCargoOwner')
|
|
|
+ }
|
|
|
+ // 可用企业货主
|
|
|
+ this.qyList = []
|
|
|
+ // 自己法人
|
|
|
+ let _self = res.data.companyInfoList
|
|
|
+ //代理货主
|
|
|
+ let _dlhz = res.data.cargoOwnerCompInfoList
|
|
|
+ for (let i = 0; i < _self.length; i++) {
|
|
|
+ if (_self[i].status == '已认证') {
|
|
|
+ this.qyList.push(_self[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (let i = 0; i < _dlhz.length; i++) {
|
|
|
+ if (_dlhz[i].status == '已认证') {
|
|
|
+ this.qyList.push(_dlhz[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (let i = 0; i < this.qyList.length; i++) {
|
|
|
+ this.columns[0].push(this.qyList[i].company ? this.qyList[i].company : this.qyList[i]
|
|
|
+ .companyName)
|
|
|
+ }
|
|
|
+ console.log('1111', _this.columns)
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ validate() {
|
|
|
+ if (uni.$u.test.isEmpty(this.dataObj.cargoOwner)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "货主不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(this.dataObj.sendArea)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "发货地区不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(this.dataObj.unloadArea)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "收货地区不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(this.dataObj.goodsName)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "货名不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (uni.$u.test.isEmpty(this.dataObj.freightPrice)) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "运费单价不能为空!",
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.dataObj.freightPrice < 0 || this.dataObj.freightPrice > 100000 || (
|
|
|
+ String(this.dataObj.freightPrice).indexOf('.') != -1 && String(tthis.dataObj.freightPrice).length -
|
|
|
+ (String(this.dataObj.freightPrice).indexOf(
|
|
|
+ '.') + 1) > 2)
|
|
|
+ ) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '运费单价输入错误!',
|
|
|
+ duration: 2000,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ if (this.dataObj.weight) {
|
|
|
+ if (
|
|
|
+ this.dataObj.weight < 0.1 || this.dataObj.weight > 10000000 || (
|
|
|
+ String(this.dataObj.weight).indexOf('.') != -1 && String(tthis.dataObj.weight).length -
|
|
|
+ (String(this.dataObj.weight).indexOf(
|
|
|
+ '.') + 1) > 2)
|
|
|
+ ) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '重量输入错误!',
|
|
|
+ duration: 2000,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.dataObj.carLengthSmall) {
|
|
|
+ if (this.dataObj.carLengthSmall < 2 || this.dataObj.carLengthSmall > 30) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '最小车长输入错误!',
|
|
|
+ duration: 2000,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.dataObj.carLength) {
|
|
|
+ if (this.dataObj.carLength < 2 || this.dataObj.carLength > 30) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '最大车长输入错误!',
|
|
|
+ duration: 2000,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.dataObj.carLengthSmall && this.dataObj.carLength && (this.dataObj.carLengthSmall > this.dataObj
|
|
|
+ .carLength)) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '最小车长应小于最大车长!',
|
|
|
+ duration: 2000,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.dataObj.loadWeightSmall) {
|
|
|
+ if (
|
|
|
+ this.dataObj.loadWeightSmall < 0.1 || this.dataObj.loadWeightSmall > 100 || (
|
|
|
+ String(this.dataObj.loadWeightSmall).indexOf('.') != -1 && String(this.dataObj
|
|
|
+ .loadWeightSmall).length -
|
|
|
+ (String(this.dataObj.loadWeightSmall).indexOf(
|
|
|
+ '.') + 1) > 3)
|
|
|
+ ) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '最小载重输入错误!',
|
|
|
+ duration: 2000,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.dataObj.loadWeight) {
|
|
|
+ if (
|
|
|
+ this.dataObj.loadWeight < 0.1 || this.dataObj.loadWeight > 100 || (
|
|
|
+ String(this.dataObj.loadWeight).indexOf('.') != -1 && String(this.dataObj.loadWeight).length -
|
|
|
+ (String(this.dataObj.loadWeight).indexOf(
|
|
|
+ '.') + 1) > 3)
|
|
|
+ ) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '最大载重输入错误!',
|
|
|
+ duration: 2000,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.dataObj.loadWeightSmall && this.dataObj.loadWeight && (this.dataObj.loadWeightSmall > this.dataObj
|
|
|
+ .loadWeight)) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '最小载重应小于最大载重!',
|
|
|
+ duration: 2000,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ confirmClick() {
|
|
|
+ this.isShowAlert = false
|
|
|
+ if (this.validate()) return
|
|
|
+ if (this.dataObj.billingMethod == '元/吨') {
|
|
|
+ this.dataObj.billingMethod = 0
|
|
|
+ } else {
|
|
|
+ this.dataObj.billingMethod = 1
|
|
|
+ }
|
|
|
+ if (this.dataObj.freightAdvance) {
|
|
|
+ this.dataObj.freightAdvance = 1
|
|
|
+ } else {
|
|
|
+ this.dataObj.freightAdvance = 0
|
|
|
+ }
|
|
|
+ let _list = []
|
|
|
+ for (let i = 0; i < this.checkboxValue1.length; i++) {
|
|
|
+ if (this.checkboxValue1[i] == '不限') {
|
|
|
+ _list.push(1)
|
|
|
+ } else if (this.checkboxValue1[i] == '高栏') {
|
|
|
+ _list.push(2)
|
|
|
+ } else if (this.checkboxValue1[i] == '集装箱') {
|
|
|
+ _list.push(3)
|
|
|
+ } else if (this.checkboxValue1[i] == '自卸车') {
|
|
|
+ _list.push(4)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.dataObj.carModel = _list.toString()
|
|
|
+ this.dataObj.commonId = this.userInfo.id
|
|
|
+ this.$request.baseRequest('post', '/publishTaskInfo/api/editTask', this.dataObj).then(res => {
|
|
|
+
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'success',
|
|
|
+ message: "修改成功",
|
|
|
+ complete() {
|
|
|
+
|
|
|
+ _this.dataObj = {
|
|
|
+ commonId: '',
|
|
|
+ cargoOwner: '',
|
|
|
+ sendPrivate: '',
|
|
|
+ sendCity: '',
|
|
|
+ sendArea: '',
|
|
|
+ sendDetailedAddress: '',
|
|
|
+ unloadPrivate: '',
|
|
|
+ unloadCity: '',
|
|
|
+ unloadArea: '',
|
|
|
+ unloadDetailedAddress: '',
|
|
|
+ distance: '',
|
|
|
+ goodsName: '',
|
|
|
+ billingMethod: '元/吨',
|
|
|
+ freightPrice: '',
|
|
|
+ freightAdvance: true,
|
|
|
+ sender: '',
|
|
|
+ senderPhone: '',
|
|
|
+ receiver: '',
|
|
|
+ receiverPhone: '',
|
|
|
+ weight: '',
|
|
|
+ loadingDateStart: '',
|
|
|
+ loadingDateEnd: '',
|
|
|
+ carLengthSmall: '',
|
|
|
+ carLength: '',
|
|
|
+ loadWeightSmall: '',
|
|
|
+ loadWeight: '',
|
|
|
+ carModel: '',
|
|
|
+ taskDescription: '',
|
|
|
+ taskValidity: '',
|
|
|
+ sendLongitude: '',
|
|
|
+ sendLatitude: '',
|
|
|
+ unsendLongitude: '',
|
|
|
+ unsendLatitude: '',
|
|
|
+ }
|
|
|
+ _this.checkboxValue1 = ['不限']
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+ cancelClick() {
|
|
|
+ this.isShowAlert = false
|
|
|
+ },
|
|
|
+ //获取默认发货地、收货地
|
|
|
+ getDefaultPlace(type) {
|
|
|
+ // 0时获取默认发货地址,1时获取默认收货地址 通过选择获取的地址无需获取默认地址
|
|
|
+ uni.showLoading({
|
|
|
+ mask: true,
|
|
|
+ title: '加载中...'
|
|
|
+ })
|
|
|
+ this.$request.baseRequest('get', '/cargoOwnerAddressInfo/addressList', {
|
|
|
+ commonId: this.userInfo.id
|
|
|
+ }).then(res => {
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
+ if (res.data[i].defaultShipment == 1 && type == 0) {
|
|
|
+ this.dataObj.sendCity = res.data[i].city
|
|
|
+ this.dataObj.sendArea = res.data[i].area
|
|
|
+ this.dataObj.sendPrivate = res.data[i].province
|
|
|
+ this.dataObj.sendDetailedAddress = res.data[i].detailedAddress
|
|
|
+ this.dataObj.sendLongitude = res.data[i].longitude
|
|
|
+ this.dataObj.sendLatitude = res.data[i].latitude
|
|
|
+ }
|
|
|
+ if (res.data[i].defaultReceipt == 1 && type == 1) {
|
|
|
+ this.dataObj.unloadDetailedAddress = res.data[i].detailedAddress
|
|
|
+ this.dataObj.unloadCity = res.data[i].city
|
|
|
+ this.dataObj.unloadArea = res.data[i].area
|
|
|
+ this.dataObj.unloadPrivate = res.data[i].province
|
|
|
+ this.dataObj.unsendLongitude = res.data[i].longitude
|
|
|
+ this.dataObj.unsendLatitude = res.data[i].latitude
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.dataObj.sendLatitude && this.dataObj.sendLongitude && this.dataObj.unsendLatitude &&
|
|
|
+ this.dataObj.unsendLongitude) {
|
|
|
+ this.dataObj.distance = this.$helper.getDistance(this.dataObj.unsendLatitude, this.dataObj
|
|
|
+ .unsendLongitude, this.dataObj.sendLatitude, this.dataObj.sendLongitude)
|
|
|
+ }
|
|
|
+ uni.hideLoading()
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
changeHandler(e) {
|
|
|
const {
|
|
|
columnIndex,
|
|
@@ -375,48 +683,89 @@
|
|
|
this.show = false
|
|
|
},
|
|
|
confirmSelectCargoOwner(e) {
|
|
|
-
|
|
|
this.dataObj.cargoOwner = e.value[0]
|
|
|
+ for (let i = 0; i < this.qyList.length; i++) {
|
|
|
+ let _name = this.qyList[i].company ? this.qyList[i].company : this.qyList[i].companyName
|
|
|
+ if (_name == e.value[0]) {
|
|
|
+ this.dataObj.freightAdvance = this.qyList[i].advanceFreightService == 1 ? true : false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ uni.setStorageSync('releaseCargoOwner', this.dataObj.cargoOwner)
|
|
|
this.show = false
|
|
|
},
|
|
|
selectCargoOwner() {
|
|
|
this.show = true
|
|
|
},
|
|
|
selectAddress(type) {
|
|
|
+ // uni.removeStorage({
|
|
|
+ // key: 'storage_faddress'
|
|
|
+ // });
|
|
|
+ uni.removeStorage({
|
|
|
+ key: 'storage_saddress'
|
|
|
+ });
|
|
|
uni.$u.route('/pages/release/selectAddress', {
|
|
|
type: type,
|
|
|
});
|
|
|
},
|
|
|
checkboxChange(n) {
|
|
|
console.log('change', n);
|
|
|
+ if (n.length > 1 && n.length < 4 && n.includes('不限')) {
|
|
|
+ n.shift(0)
|
|
|
+ } else if (n.length == 4) {
|
|
|
+ this.checkboxValue1 = n.splice(1, 4)
|
|
|
+ }
|
|
|
},
|
|
|
selectValidityPeriodcq() {
|
|
|
this.isShowcardValidity = true
|
|
|
},
|
|
|
confirmValidityPeriod(e) {
|
|
|
console.log('confirm', e)
|
|
|
- if (!e.value[1] || !e.value[2]) {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'error',
|
|
|
- message: "日期格式错误,请重新选择!",
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- switch (this.ValidityPeriodType) {
|
|
|
- case 0:
|
|
|
- this.dataObj.loadingDateStart = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
|
|
|
- break
|
|
|
- case 1:
|
|
|
- this.dataObj.loadingDateEnd = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
|
|
|
- break
|
|
|
+ if (e.value[0] == '随时') {
|
|
|
+ switch (this.ValidityPeriodType) {
|
|
|
+ case 0:
|
|
|
+ this.dataObj.loadingDateStart = e.value[0]
|
|
|
+ break
|
|
|
+ case 1:
|
|
|
+ this.dataObj.loadingDateEnd = e.value[0]
|
|
|
+ break
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!e.value[1] || !e.value[2]) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "日期格式错误,请重新选择!",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ switch (this.ValidityPeriodType) {
|
|
|
+ case 0:
|
|
|
+ this.dataObj.loadingDateStart = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
|
|
|
+ break
|
|
|
+ case 1:
|
|
|
+ this.dataObj.loadingDateEnd = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
|
|
|
+ break
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
this.isShowValidity = false
|
|
|
},
|
|
|
confirmValidityPeriodcq(e) {
|
|
|
console.log('confirm', e)
|
|
|
- this.dataObj.taskValidity = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
|
|
|
-
|
|
|
+ if (e.value[0] == '长期') {
|
|
|
+ this.dataObj.taskValidity = e.value[0]
|
|
|
+ } else {
|
|
|
+ if (!e.value[1] || !e.value[2]) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'error',
|
|
|
+ message: "日期格式错误,请重新选择!",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.dataObj.taskValidity = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
|
|
|
+ }
|
|
|
this.isShowcardValidity = false
|
|
|
},
|
|
|
selectValidityPeriod(type) {
|
|
@@ -437,56 +786,7 @@
|
|
|
this.dataDetails.type = n
|
|
|
},
|
|
|
submit() {
|
|
|
-
|
|
|
- uni.showLoading({
|
|
|
- mask: true,
|
|
|
- title: '加载中...'
|
|
|
- })
|
|
|
- // 校验没写
|
|
|
- if (this.dataObj.billingMethod == '元/吨') {
|
|
|
- this.dataObj.billingMethod = 0
|
|
|
- } else {
|
|
|
- this.dataObj.billingMethod = 1
|
|
|
- }
|
|
|
- if (this.dataObj.freightAdvance) {
|
|
|
- this.dataObj.freightAdvance = 1
|
|
|
- } else {
|
|
|
- this.dataObj.freightAdvance = 0
|
|
|
- }
|
|
|
- let _list = []
|
|
|
- for (let i = 0; i < this.checkboxValue1.length; i++) {
|
|
|
- if (this.checkboxValue1 == '不限') {
|
|
|
- _list.push(1)
|
|
|
- } else if (this.checkboxValue1 == '高栏') {
|
|
|
- _list.push(2)
|
|
|
- } else if (this.checkboxValue1 == '集装箱') {
|
|
|
- _list.push(3)
|
|
|
- } else if (this.checkboxValue1 == '自卸车') {
|
|
|
- _list.push(4)
|
|
|
- }
|
|
|
- }
|
|
|
- this.dataObj.carModel = _list.toString()
|
|
|
- this.dataObj.commonId = this.userInfo.id
|
|
|
- this.$request.baseRequest('post', '/publishTaskInfo/api/editTask', this.dataObj).then(res => {
|
|
|
-
|
|
|
- uni.hideLoading()
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'success',
|
|
|
- message: "发布成功",
|
|
|
- complete() {
|
|
|
- this.dataObj = {}
|
|
|
- uni.$u.route('/pages/release/record');
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
- uni.showToast({
|
|
|
- title: res.message,
|
|
|
- icon: 'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- });
|
|
|
+ this.isShowAlert = true;
|
|
|
},
|
|
|
}
|
|
|
}
|