123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128 |
- <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='#2772FB' @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
- }
- 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
- }
- },
- 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: #2772FB;
- 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: #2772FB;
- border: 1px solid #2772FB;
- 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: #2772FB;
- 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: #2772FB;
- }
- </style>
|