12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130 |
- <template>
- <view class="content">
- <u-navbar title="发布" :placeholder="true" @leftClick="back()">
- <!-- view class="u-nav-slot" slot="left">
- <u-icon name="arrow-left" size="19"></u-icon>
- <u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
- <u-icon name="home" size="20"></u-icon>
- </view> -->
- </u-navbar>
- <view class="content1">
- <view class="row" @click="selectCargoOwner">
- <view class="left select-sf">{{dataObj.cargoOwner?dataObj.cargoOwner:'选择货主身份'}}</view>
- <image src="../../static/right.png" style="width: 22rpx;height: 22rpx;margin-top:14rpx;"></image>
- </view>
- <!-- <view class="row" @click="selectCargoOwner" v-if="dataObj.cargoOwner">
- <view class="left">{{dataObj.cargoOwner}}</view>
- <view class="right">></view>
- </view> -->
- <u-picker :show="show" :columns="columns" :closeOnClickOverlay='true' @close='selectCargoOwnerClose'
- @cancel='selectCargoOwnerClose' @confirm='confirmSelectCargoOwner'></u-picker>
- </view>
- <view class="content2">
- <view class="row1">
- <view class="left">
- <view class="top" @click="selectAddress(0)">
- <view class="send">发</view>
- <view class="title">
- {{dataObj.sendArea?((dataObj.sendPrivate?dataObj.sendPrivate:'' )+ dataObj.sendCity+dataObj.sendArea):'选择发货地区'}}
- </view>
- </view>
- <view class="bottom">
- <input type="text" value="" placeholder="输入详细地址" v-model="dataObj.sendDetailedAddress" />
- </view>
- </view>
- <view v-if='dataObj.sendArea' class="right"></view>
- <view class="right" @click="selectAddress(0)" v-else>
- <image src="../../static/right.png" style="width: 22rpx;height: 22rpx;margin-top:14rpx;"></image>
- </view>
- </view>
- <view class="row2">
- <view class="left">
- <view class="top" @click="selectAddress(1)">
- <view class="collect">收</view>
- <view class="title">
- {{dataObj.unloadArea?((dataObj.unloadPrivate?dataObj.unloadPrivate:'') + dataObj.unloadCity+dataObj.unloadArea):'选择收货地区'}}
- </view>
- </view>
- <view class="bottom">
- <input type="text" value="" placeholder="输入详细地址" v-model="dataObj.unloadDetailedAddress" />
- </view>
- </view>
- <view v-if='dataObj.unloadPrivate' class="right"></view>
- <view class="right" @click="selectAddress(1)" v-else>
- <image src="../../static/right.png" style="width: 22rpx;height: 22rpx;margin-top:14rpx;"></image>
- </view>
- </view>
- </view>
- <view class="content3">
- <view class="row">
- <view class="left">距离</view>
- <!-- <input type="text" class="input" placeholder="自动计算" v-model="dataObj.distance" disabled /> -->
- <view class="input">{{dataObj.distance?dataObj.distance:"自动计算"}} km</view>
- </view>
- <view class="row">
- <view class="left">业务类型</view>
- <view class="right" >{{dataObj.businessType?dataObj.businessType:"请选择业务类型"}}
- </view>
- </view>
- <view class="row">
- <view class="left">货物类别</view>
- <view class="right" @click="goodstypeChange">{{dataObj.goodsType?dataObj.goodsType:"请选择货物类别"}}</view>
- </view>
- <view class="row">
- <view class="left">货名</view>
- <view class="right"><input type="text" class="input" value="" placeholder="输入货物名称"
- v-model="dataObj.goodsName" /></view>
- </view>
- <view class="row">
- <view class="left">收货方</view>
- <view class="right flex">
- <input type="text" value="" placeholder="输入收货方姓名或企业名称" class="input" v-model="dataObj.receiver" />
- </view>
- </view>
- <view class="row">
- <view class="left">收货方手机号</view>
- <view class="right flex">
- <input type="number" maxlength="11" placeholder="输入收货方手机号" class="input"
- v-model="dataObj.receiverPhone" />
- </view>
- </view>
- <view class="row">
- <view class="left" style="width: 240rpx;">收货方身份证号(选填)</view>
- <view class="right flex">
- <input type="number" maxlength="18" placeholder="输入收货人身份证号" class="input"
- v-model="dataObj.receiverIdcard" />
- </view>
- </view>
- <view class="row">
- <view class="left" style="width: 240rpx;">收货方信用代码(选填)</view>
- <view class="right flex">
- <input maxlength="18" placeholder="统一社会信用代码" class="input" v-model="dataObj.receiverCreditCode" />
- </view>
- </view>
- <view class="flex row">
- <view class="left-text">运费计算方式</view>
- <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">
- </u-radio>
- </u-radio-group>
- </view>
- <view class="row">
- <view class="left">运费单价</view>
- <view class="right"><input type="number" value="" placeholder="输入运费单价" class="input"
- v-model="dataObj.freightPrice" /></view>
- </view>
- <view class="row" v-if="freightAdvance">
- <view class="left">该任务申请运费垫付</view>
- <view class="right">
- <u-switch v-model="dataObj.freightAdvance" @change="change" size="20"></u-switch>
- </view>
- </view>
- </view>
- <view class="content4 flex">
- <view class="title">以下为附加信息</view>
- <view class="btn-text">选填</view>
- </view>
- <view class="content5">
- <view class="row">
- <view class="left">发货联系人</view>
- <view class="right flex">
- <input type="text" value="" placeholder="输入发货联系人姓名" class="input" v-model="dataObj.sender" />
- </view>
- </view>
- <view class="row">
- <view class="left">发货人手机号</view>
- <view class="right flex">
- <input type="number" maxlength="11" value="" placeholder="输入发货联系人手机号" class="input"
- v-model="dataObj.senderPhone" />
- </view>
- </view>
-
- <view class="row">
- <view class="left">重量(吨)</view>
- <view class="right flex">
- <input type="text" value="" placeholder="输入预计发运重量" class="number" v-model="dataObj.weight"
- style="text-align: right;" />
- </view>
- </view>
- <view class="flex row" @click="selectValidityPeriod(0)">
- <view class="left-text">预计装车日期起</view>
- <view :class="!dataObj.loadingDateStart?'select-data':''">
- {{dataObj.loadingDateStart?dataObj.loadingDateStart:'选择有效截止日期>'}}
- </view>
- </view>
- <view class="flex row" @click="selectValidityPeriod(1)">
- <view class="left-text">预计装车日期止</view>
- <view :class="!dataObj.loadingDateEnd?'select-data':''">
- {{dataObj.loadingDateEnd?dataObj.loadingDateEnd:'选择有效截止日期>'}}
- </view>
- </view>
- <view class="row">
- <view class="left">车长要求(米)</view>
- </view>
- <view class="row flex-space-between row-bgc">
- <view class="car-row">
- <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="number" value="" placeholder="最长不限" class="" v-model="dataObj.carLength"
- class="car-input" />
- <view>m</view>
- </view>
- </view>
- <view class="row">
- <view class="left">载重要求(吨)</view>
- </view>
- <view class="row flex-space-between row-bgc">
- <view class="car-row">
- <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="number" value="" placeholder="最大不限" class="car-input" v-model="dataObj.loadWeight" />
- <view>吨</view>
- </view>
- </view>
- <view class="row">
- <view class="left">车型要求</view>
- </view>
- <view class="row">
- <u-checkbox-group v-model="checkboxValue1" placement="row" @change="checkboxChange">
- <u-checkbox :customStyle="radioCustomStyle" v-for="(item, index) in checkboxList1" :key="index"
- :label="item.name" :name="item.name">
- </u-checkbox>
- </u-checkbox-group>
- </view>
- <view class="row">
- <view class="left">任务描述</view>
- </view>
- <view class="row">
- <u--textarea v-model="dataObj.taskDescription" placeholder="请输入内容" :count='true' maxlength='200'>
- </u--textarea>
- </view>
- <view class="flex row noborder" @click="selectValidityPeriodcq">
- <view class="left-text">任务有效期</view>
- <view :class="dataObj.taskValidity?'':'select-data'">
- {{dataObj.taskValidity?dataObj.taskValidity:'选择任务有效期>'}}
- </view>
- </view>
- <!-- <u-picker :show="isShowcardValidity" ref="uPicker" :columns="validityPeriodcq"
- @confirm="confirmValidityPeriodcq" @change="changeHandler" @close='isShowcardValidity=false'
- @cancel='isShowcardValidity=false' :closeOnClickOverlay='true'>
- </u-picker> -->
- <itmister-date-picker :overdueContent="'任务已过期'" :dateStatus="1" :periodOfValidity="true" :startYear='2022' :checkYear="year" :checkMonth="month" :checkDay="day" ref="dateEl" :endDate="array" :futureYear="30" @dateConfirm="confirmValidityPeriodcq"></itmister-date-picker>
-
- <view class="flex row noborder">
- <view class="left-text flex">查看
- <u--text type="primary" text="《货物运输委托协议》" @click="lookContract"></u--text>
- </view>
- </view>
- </view>
- <view class="submit" @click="submit">下一步</view>
-
- <!-- <u-picker :show="isShowValidity" ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
- :closeOnClickOverlay='true' @close='isShowValidity=false' @cancel='isShowValidity=false'>
- </u-picker> -->
- <itmister-date-picker :dateStatus="2" :startYear='2022' ref="datezc" :futureYear="30" :checkYear="year" :checkMonth="month" :checkDay="day" @dateConfirm="confirmValidityPeriod"></itmister-date-picker>
- <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
- :showCancelButton='true' confirmColor='#F5BA3C' @confirm="$u.throttle(confirmClick(), 1000)" @close="cancelClick"
- @cancel="cancelClick"></u-modal>
- <u-toast ref="uToast"></u-toast>
- </view>
- </template>
- <script>
- var _this;
- import {
- mapState
- } from 'vuex';
- export default {
- data() {
- return {
- qyList: [],
- isShowAlert: false,
- alertTitle: '确定发布运输任务?',
- alertContent: null,
- radioCustomStyle: {
- margin: '0 0 0 20rpx'
- },
- show: false,
- freightAdvance:false,
- columns: [
- []
- ],
- array:{},
- year:'',
- month:'',
- day:'',
- 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: '',
- },
- checkboxValue1: [],
- checkboxList1: [{
- name: '不限',
- disabled: false
- },
- {
- name: '高栏',
- disabled: false
- },
- {
- name: '集装箱',
- disabled: false
- },
- {
- name: '自卸车',
- disabled: false
- }
- ],
- value: true,
- isShowcardValidity: false,
- ValidityPeriodType: '',
- validityPeriod: [],
- validityPeriodcq: [],
- isShowValidity: false,
- dataDetails: {
- type: '元/车'
- },
- radiolist1: [{
- name: '元/吨',
- disabled: false
- },
- {
- name: '元/车',
- disabled: false
- },
- ],
- }
- },
- onShow() {
-
- this.getSFList()
- 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
- this.dataObj.senderPhone = _faddress.contactPhone
- this.dataObj.sender = _faddress.contacts
- this.dataObj.sendAdCode = _faddress.adCode
- }
- 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
- this.dataObj.receiver = _saddress.contacts
- this.dataObj.receiverPhone = _saddress.contactPhone
- this.dataObj.unsendAdCode = _faddress.adCode
- }
- },
- onLoad(options) {
- _this = this;
- _this = this;
- this.dataObj = options
- if (this.dataObj.billingMethod == 1) {
- this.dataObj.billingMethod = '元/车'
- } 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') {
- this.checkboxValue1.push('高栏')
- } else if (this.dataObj.carModel[i] == '3') {
- this.checkboxValue1.push('集装箱')
- } else if (this.dataObj.carModel[i] == '4') {
- this.checkboxValue1.push('自卸车')
- }
- }
- if (this.dataObj.freightAdvance==1) {
- this.dataObj.freightAdvance = true
- this.freightAdvance=true
- } else {
- this.dataObj.freightAdvance = false
- this.freightAdvance=false
- }
- this.validityPeriod = this.$helper.makeValidityPeriod(0, '随时')
- this.validityPeriodcq = this.$helper.makeValidityPeriod(0, '长期')
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo']),
- },
- methods: {
- lookContract(){
- uni.downloadFile({
- url: "https://taohaoliang.oss-cn-beijing.aliyuncs.com/pcfiles/hzContract.pdf",
- success: function(res) {
- var filePath = res.tempFilePath;
- uni.openDocument({
- filePath: filePath,
- showMenu: true,
- success: function(res) {
- console.log('打开文档成功');
- }
- });
- }
- });
- },
- goodstypeChange(){
- this.isGoodsType = true
- },
- goodsSubmit(e){
- this.dataObj.goodsType = e.value[0].constValue
- this.dataObj.goodsTypeKey = e.value[0].constKey
- let _obj={
- name:e.value[0].constValue,
- key:e.value[0].constKey
- }
- uni.setStorageSync("goodsType",_obj)
- this.isGoodsType = false
- },
- 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
- if(_self){
- for (let i = 0; i < _self.length; i++) {
- _self[i].compStatus='wd'
- if (_self[i].status == '已认证') {
- this.qyList.push(_self[i])
- }
- }
- }
- if(_dlhz){
- for (let i = 0; i < _dlhz.length; i++) {
- _dlhz[i].compStatus='ss'
- if (_dlhz[i].status == '已认证') {
- this.qyList.push(_dlhz[i])
- }
- }
- }
- let obj = uni.getStorageSync("firstAuthentication")
- if(obj && obj.authenticationStatus == '已认证'){
- this.columns[0].push("个人货主")
- }
- 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)
- }
- })
- .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.receiver)) {
- this.$refs.uToast.show({
- type: 'error',
- message: "收货方不能为空!",
- })
- return true
- }
- if (uni.$u.test.isEmpty(this.dataObj.receiverPhone)) {
- this.$refs.uToast.show({
- type: 'error',
- message: "收货方手机号不能为空!",
- })
- return true
- }
- if (!this.dataObj.receiverIdcard && !this.dataObj.receiverCreditCode) {
- this.$refs.uToast.show({
- type: 'error',
- message: "信用代码和身份证号码至少填写一个!",
- duration:4000
- })
- return true
- }
- if(this.dataObj.receiverIdcard&&this.dataObj.receiverIdcard.length!=18){
- this.$refs.uToast.show({
- type: 'error',
- message: "身份证号输入错误!",
- })
- return true
- }
- if(this.dataObj.receiverCreditCode&&this.dataObj.receiverCreditCode.length!=18){
- 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(this.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(this.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 && (Number(this.dataObj.carLengthSmall) > Number(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 && (Number(this.dataObj.loadWeightSmall)>Number(this.dataObj.loadWeight))) {
- uni.showToast({
- title: '最小载重应小于最大载重!',
- duration: 2000,
- icon: "none",
- });
- return true
- }
- },
- confirmClick() {
- this.isShowAlert = false
-
- 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
- uni.$u.route('/pages/order/signContract', {
- obj: JSON.stringify(this.dataObj),
- type:2,//编辑
- });
- // this.$request.baseRequest('post', '/publishTaskInfo/api/editTask', this.dataObj).then(res => {
- // if(res.code == 200){
- // uni.$u.route('/pages/order/signContract', {
- // obj: JSON.stringify(this.dataObj)
- // });
- // }
- // })
- // .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 => {
- uni.hideLoading()
- 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)
- }
-
- })
- .catch(res => {
- uni.hideLoading()
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration: 2000
- })
- });
- },
- changeHandler(e) {
- const {
- columnIndex,
- value,
- values,
- index,
- picker = this.$refs.uPicker
- } = e
- // if (columnIndex === 0) {
- //
- // if (e.index != 0) {
- // picker.setColumnValues(1, this.validityPeriod[1].shift())
- // }
- // } else if (columnIndex === 1) {
- // if (e.index != 0) {
- // picker.setColumnValues(2, this.validityPeriod[2].shift())
- // }
- // }
- },
- selectCargoOwnerClose() {
- 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
- // },
- 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]) {
- if(e.value[0]!='个人货主'){
- this.freightAdvance=true
- if(this.qyList[i].compStatus=='ss'){
- this.dataObj.compId=this.qyList[i].compId
- }else{
- this.dataObj.compId=this.qyList[i].id
- }
- // console.log(this.qyList[i].compStatus,this.dataObj.compId)
- uni.setStorageSync('releasecompId', this.dataObj.compId)
- }else{
- this.freightAdvance=false
- }
- this.freightAdvance= this.qyList[i].advanceFreightService == 1 ? true : false
- 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,
- status:1
- });
- },
- 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() {
- var datetime = new Date().getTime()
- var datetime1 = datetime + (24 * 60 * 60 * 1000 * 30 * 6)
- var date=new Date(datetime1)
- this.array={year:date.getFullYear(),month:date.getMonth() + 1,day:date.getDate()}
- console.log(this.array)
- if(this.dataObj.taskValidity&&this.dataObj.taskValidity!='长期'){
- const arr=this.dataObj.taskValidity.split('-')
- this.year=arr[0]
- this.month=arr[1]
- this.day=arr[2]
- }
- if(this.dataObj.taskValidity=='长期'){
- this.year='长期'
- this.month=''
- this.day=''
- }
- this.$refs.dateEl.show()
- },
- confirmValidityPeriod(date) {
- switch (this.ValidityPeriodType) {
- case 0:
- this.dataObj.loadingDateStart =date.date
- break
- case 1:
- this.dataObj.loadingDateEnd = date.date
- break
- }
- },
- confirmValidityPeriodcq(date) {
- this.dataObj.taskValidity = date.date
- },
- selectValidityPeriod(type) {
- this.ValidityPeriodType = type
- switch (this.ValidityPeriodType) {
- case 0:
- if(this.dataObj.loadingDateStart&&this.dataObj.loadingDateStart!='随时'){
- const arr=this.dataObj.loadingDateStart.split('-')
- this.year=arr[0]
- this.month=arr[1]
- this.day=arr[2]
- }
- if(this.dataObj.loadingDateStart=='随时'){
- this.year='随时'
- this.month=''
- this.day=''
- }
- break
- case 1:
- if(this.dataObj.loadingDateEnd&&this.dataObj.loadingDateEnd!='随时'){
- const arr=this.dataObj.loadingDateEnd.split('-')
- this.year=arr[0]
- this.month=arr[1]
- this.day=arr[2]
- }
- if(this.dataObj.loadingDateEnd=='随时'){
- this.year='随时'
- this.month=''
- this.day=''
- }
- break
-
- }
- this.$refs.datezc.show()
- },
- change(e) {
- console.log('change', e);
- },
- back() {
- uni.navigateBack()
- },
- goToRecord() {
- uni.$u.route('/pages/release/record');
- },
- radioChange(n) {
- console.log('radioChange', n);
- this.dataDetails.type = n
- },
- submit() {
- if (this.validate()) return
- this.confirmClick()
- // this.isShowAlert = true;
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .input {
- text-align: right;
- }
- .title {
- padding: 0 20rpx;
- display: flex;
- justify-content: center;
- position: relative;
- .nav-title {
- font-size: 32rpx;
- }
- .back {
- position: absolute;
- left: 20rpx;
- }
- .search {
- display: flex;
- align-items: center;
- position: absolute;
- right: 20rpx;
- }
- }
- .fixed1 {
- height: var(--status-bar-height);
- }
- .row {
- display: flex;
- justify-content: space-between;
- }
- .content1 {
- background: white;
- margin: 20rpx 20rpx 0 20rpx;
- border-radius: 20rpx;
- padding: 40rpx;
- .select-sf {
- color: #999999;
- }
- .right {
- color: #CBCBCB
- }
- }
- .content2,
- .content3,
- .content5 {
- box-sizing: border-box;
- background: white;
- border-radius: 20rpx;
- padding: 20rpx;
- margin: 20rpx;
- .row {
- margin: 30rpx;
- }
- .row1,
- .row2 {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .left .top {
- display: flex;
- }
- }
- }
- .select-type {
- display: flex;
- justify-content: flex-end;
- }
- .content2 {
- padding: 40rpx;
- .row1,
- .row2 {
- .left {
- width: 100%;
- }
- .right {
- color: #CBCBCB
- }
- }
- .row2 {
- margin-top: 40rpx;
- }
- .top {
- display: flex;
- align-items: center;
- }
- .bottom {
- margin-top: 10rpx;
- padding-left: 72rpx;
- }
- .title {
- font-size: 36rpx;
- font-weight: 700;
- color: #171717;
- }
- .collect {
- width: 40rpx;
- height: 40rpx;
- line-height: 40rpx;
- background: #F5BA3C;
- color: white;
- padding: 6rpx;
- border-radius: 50%;
- text-align: center;
- }
- .send {
- width: 40rpx;
- height: 40rpx;
- line-height: 40rpx;
- background: #101010;
- color: white;
- padding: 6rpx;
- border-radius: 50%;
- text-align: center;
- }
- }
- .content3 {}
- .content4 {
- margin: 20rpx;
- padding-left: 20rpx;
- .title {
- color: #999999;
- }
- .btn-text {
- color: #F5BA3C;
- border: 1px solid #F5BA3C;
- border-radius: 40rpx;
- padding: 0rpx 10rpx;
- box-sizing: border-box;
- }
- }
- .submit {
- width: 90%;
- margin: 100rpx auto;
- font-size: 36rpx;
- font-weight: 500;
- color: #FFFFFF;
- background: #F5BA3C;
- text-align: center;
- padding: 20rpx 0;
- border-radius: 50rpx;
- }
- .select-data {
- color: #999999;
- }
- .row-bgc {
- background: #F7F8FA;
- padding: 20rpx 30rpx;
- box-sizing: border-box;
- border-radius: 10rpx;
- }
- .car-input {
- // padding:20rpx;
- // box-sizing: border-box;
- // border-radius: 10px;
- }
- .car-line {
- margin: 0 20rpx;
- }
- .car-row {
- display: flex;
- background: white;
- padding: 20rpx;
- box-sizing: border-box;
- border-radius: 10rpx;
- }
- uni-navigator {//条款
- display: inline-block;
- color: #F5BA3C;
- }
- </style>
|