12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217 |
- <template>
- <view class="content">
- <u-sticky>
- <view class="head-no">
- <!-- <text>订单号: {{formData.orderNo}}</text> -->
- <view>
- <text>{{ formData.carRegNo == null ? '' : formData.carRegNo }}</text>
- </view>
- <view>
- <text>{{ formData.goodsCName == null ? '' : formData.goodsCName }}</text>
- </view>
- </view>
- <view class="head-no-addr">
- <view>
- <text>{{formData.loadAddr}}</text>
- </view>
- <!-- <span class="icon iconfont" style="font-size: 100rpx; color: #fcbd71; height: 80rpx;"></span> -->
- <view><text>【到】</text></view>
- <view>
- <text>{{formData.unLoadAddr}}</text>
- </view>
- </view>
- </u-sticky>
- <u-sticky>
- </u-sticky>
- <view class="striping"></view>
- <!-- <view class="head a-blue" @click="telFun">
- <text>驾驶员: {{formData.driver1Name == null ? '' : formData.driver1Name}} {{formData.driver1mobile == null ? '' : formData.driver1mobile}}</text>
- </view> -->
- <!-- <u-tabs :list="tabs" @change="change" :activeStyle="{
- width: '180rpx',
- height: '60rpx',
- color: '#fff',
- backgroundColor: '#3c9cff',
- borderRadius: '80rpx',
- lineHeight: '60rpx',
- textAlign: 'center'
- }" :inactiveStyle="{
- width: '180rpx',
- height: '60rpx',
- color: '#3c9cff',
- backgroundColor: '#f0f0f0f0',
- borderRadius: '80rpx',
- lineHeight: '60rpx',
- textAlign: 'center'
- }"></u-tabs> -->
- <view v-if="isTabs == '装卸确认'">
- <view class="box-box">
- <view class="box-two">
- <!-- <text style="color: red;">*</text> -->
- <text class="key">装车吨位</text>
- <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
- @input="checkLoadQty" v-model="formData.loadQty" />
- </view>
- <view class="box-two">
- <text class="key">装车时间</text>
- <uni-datetime-picker class="value-two" :start="startDate" :end="end" :disabled="disabled"
- :hide-second="true" v-model="formData.loadDateString" :border="false"></uni-datetime-picker>
- <view class="today" @click="today('ZC')"><text>今天</text></view>
- </view>
- <view class="box-two">
- <text class="key">卸车吨位</text>
- <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
- @input="checkUnLoadQty" v-model="formData.unLoadQty" />
- </view>
- <view class="box-two">
- <text class="key">卸车时间</text>
- <uni-datetime-picker class="value-two" :start="formData.loadDateString" :end="end"
- :hide-second="true" :disabled="disabled" v-model="formData.unLoadDateString" :border="false"></uni-datetime-picker>
- <view class="today" @click="today('XC')"><text>今天</text></view>
- </view>
- <!-- <view class="box">
- <view class="data">
- <text class="key">空载起点</text>
- <input class="value" selection-start="0" selection-end="9999" :disabled="disabled"
- v-model="formData.emptyaddr1" />
- </view>
- <view class="data">
- <text class="key">空车里程</text>
- <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
- v-model="formData.odometerstart" />
- </view>
- </view>
- <view class="box">
- <view class="data">
- <text class="key">空载终点</text>
- <input class="value" selection-start="0" selection-end="9999" :disabled="disabled"
- v-model="formData.emptyaddr2" />
- </view>
- <view class="data">
- <text class="key">空车里程</text>
- <input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
- v-model="formData.odometerend" />
- </view>
- </view>
- <view class="box-two">
- <text class="key">重车里程</text>
- <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
- @input="checkUnLoadmile" v-model="formData.loadmile" />
- </view> -->
- <!-- ORDER BILLS PLANS -->
- <!-- @change="checkboxChange" -->
- <u-checkbox-group v-model="detour" style="margin-left: 20rpx;" placement="column">
- <u-checkbox :customStyle="{marginBottom: '8px'}" @change="checkboxChange" :disabled="disabled" key="1" label="行程绕路" name="行程绕路">
- </u-checkbox>
- </u-checkbox-group>
- <view v-if="detour.length > 0">
- <!-- <view class="box-two">
- <view style="width: 48%; display: flex;">
- <text class="key" style="width: 200rpx;">绕路里程空</text>
- <input class="value-two" style="width: 200rpx;" selection-start="0" selection-end="9999" :disabled="disabled"
- @input="checkUnDetourEmptyMile" v-model="formData.detourEmptyMile" />
- </view>
- <view style="width: 4%; height: 200rpx;"></view>
- <view style="width: 48%; display: flex;">
- <text class="key" style="width: 200rpx; margin: 0 10rpx;">绕路里程重</text>
- <input class="value-two" style="width: 200rpx;" selection-start="0" selection-end="9999" :disabled="disabled"
- @input="checkUnDetourLoadMile" v-model="formData.detourLoadMile" />
- </view>
- </view> -->
- <view class="box-two">
- <text class="key" style="width: 300rpx;">绕路里程空(公里)</text>
- <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled"
- @input="checkUnDetourEmptyMile" v-model="formData.detourEmptyMile" />
- </view>
- <view class="box-two">
- <text class="key" style="width: 300rpx;">绕路里程重(公里)</text>
- <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled"
- @input="checkUnDetourLoadMile" v-model="formData.detourLoadMile" />
- </view>
- <view class="box-two">
- <text class="key" style="width: 300rpx;">绕 路 原 因</text>
- <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled"
- v-model="formData.detourDesc" />
- </view>
- </view>
- </view>
- <view class="box-box" style="margin-top: 40rpx;">
- <view style="margin-bottom: 20rpx;">
- <text style="color: #3c9cff;">单据拍照存档 (请上传图片大小为1MB以下的图片)</text>
- </view>
- <u-upload :fileList="fileList1" :sizeType="['compressed']"
- @afterRead="imgUploading" :disabled="disabled" @delete="deletePic" name="1" multiple :previewFullImage="true"
- ></u-upload>
- </view>
- <view class="box-box">
- <view class="box-two">
- <text class="key">备 注</text>
- <input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled"
- v-model="formData.driverassdesc" />
- </view>
- </view>
- <view class="attention">
- <view style="color: red;"><text>注意事项:</text></view>
- <!-- <text class="text-grey1">请查看</text>
- <text @click="attention()" class="text-blue">注意事项</text> -->
- {{this.formData.remarks ? this.formData.remarks:''}}
- </view>
- </view>
- <!-- <view v-if="isTabs == '订单信息'">
- <view class="box-two textAlign">
- <text class="key">货物名称</text>
- <text class="value">{{formData.goodsCName == null ? "" : formData.goodsCName}}</text>
- </view>
- <view class="box-two textAlign">
- <text class="key">装车地点</text>
- <text class="value">{{formData.loadAddr == null ? "" : formData.loadAddr}}</text>
- </view>
- <view class="box-two textAlign">
- <text class="key">装车厂家</text>
- <text class="value">{{formData.loadFactory == null ? "" : formData.loadFactory}}</text>
- </view>
- <view class="box-two textAlign">
- <text class="key">联系人电话</text>
- <text
- class="value">{{formData.loadAttn == null ? "" : formData.loadAttn}} {{formData.loadAttnTel == null ? "" : formData.loadAttnTel}}</text>
- </view>
- <view class="box-two textAlign">
- <text class="key">卸车地点</text>
- <text class="value">{{formData.unLoadAddr == null ? "" : formData.unLoadAddr}}</text>
- </view>
- <view class="box-two textAlign">
- <text class="key">卸车厂家</text>
- <text class="value">{{formData.unLoadFactory == null ? "" : formData.unLoadFactory}}</text>
- </view>
- <view class="box-two textAlign">
- <text class="key">联系人电话</text>
- <text
- class="value">{{formData.unLoadAttn == null ? "" : formData.unLoadAttn}} {{formData.unLoadAttnTel == null ? "" : formData.unLoadAttnTel}}</text>
- </view>
- <view class="attention">
- <text class="text-grey1">请查看</text>
- <text @click="attention()" class="text-blue">注意事项</text>
- </view>
- </view> -->
- <view class="cushion">
- </view>
- <view class="bottom" style="z-index: 4;">
- <view class="row" v-if="formData.ifLoaded == 'T' && (formData.ifUnLoaded == 'T' || formData.ifUnLoaded == 'F') && (formData.ifOrder2ed == 'T' || formData.ifOrder2ed == 'F')">
- <view class="button" style="width: 300rpx;">
- <u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="disabled"
- @click="disabledClick" text="保存数据"></u-button>
- </view>
- <view class="button" style="width: 300rpx;">
- <u-button iconColor="#fe8c00;" color="#fe8c00" shape="circle" type="primary" :disabled="disabled"
- @click="upDisabledClick" text="卸车确认"></u-button>
- </view>
- </view>
-
- <view class="row" v-else>
- <view class="button">
- <u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="disabled"
- @click="disabledClick" text="保存数据"></u-button>
- </view>
- </view>
- </view>
- <!-- <view class="bottom" style="z-index: 4;">
- <view class="row">
- <view class="button">
- <u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="disabled"
- @click="disabledClick" text="保存数据"></u-button>
- </view>
- <view class="button">
- <u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="disabled" @click=""
- @click="submitAudits" text="提交里程"></u-button>
- </view>
- </view>
- </view> -->
- <!-- 遮盖罩 -->
- <u-loading-page :loading="loading" style="z-index: 999;"></u-loading-page>
- <!-- 消息提示 -->
- <u-toast ref="uToast"></u-toast>
- <!-- 删除图片弹出框 -->
- <u-modal :show="deleteShow" title="提示" showCancelButton @confirm="deleteImg" @cancel="deleteShow = false">
- <view class="slot-content">
- <rich-text nodes="确定删除这张图片吗?"></rich-text>
- </view>
- </u-modal>
- <u-modal :show="submitShow" title="提示" showCancelButton @confirm="setOrderBillsPlansByid"
- @cancel="submitShow = false">
- <view class="slot-content">
- <rich-text nodes="确定要提交装卸信息吗?"></rich-text>
- </view>
- </u-modal>
-
- <u-modal :show="upCancel" title="提示" showCancelButton @confirm="upReceipts"
- @cancel="upCancel = false">
- <view class="slot-content">
- <rich-text nodes="确定要卸车吗?"></rich-text>
- </view>
- </u-modal>
- </view>
- </template>
- <script>
- import {
- getOrderBillsPlansByid,
- putOrderBillsPlansByid,
- insertTmsAttachMngs,
- pictureUploading,
- deleteTmsAttachMngs,
- audit,
- submitAudit,
- upReceipts
- } from "@/api/particulars"
- import {
- getGasStations,
- getItems,
- insertLoadFeeItems,
- getLoadFeeItems
- } from "@/api/reimbursement"
- import {
- login
- } from "../../api/login";
- export default {
- data() {
- return {
- // 遮盖罩
- loading: true,
- formData: {},
- // 表单验证
- rules: {
- loadQty: '',
- loadDateString: '',
- unLoadQty: '',
- unLoadDateString: '',
- // emptyaddr1: '',
- // odometerstart: '',
- // emptyaddr2: '',
- // odometerend: '',
- loadmile: '',
- remarks: ''
- },
- orderNo: '',
- // 照片
- fileList1: [],
- // 删除弹框
- deleteShow: false,
- // 提交里程弹窗
- submitShow: false,
- // 提交报账单弹窗
- upCancel: false,
- // 删除的图片
- event: {},
- // 输入框禁用
- disabled: false,
- status317: 0,
- status376: 0,
- // 当前时间的前60天
- startDate: '',
- tabs: [{
- name: '装卸确认'
- }, {
- name: '订单信息'
- }],
- isTabs: '装卸确认',
- // 绕路选项
- detour: [],
- end: new Date() + ''
- };
- },
- onLoad: function(option) {
- this.status317 = option.status;
- this.status376 = option.status;
- this.orderNo = option.orderNo;
- this.getData();
- },
- onUnload() {
- this.formData = {};
- this.loading = true;
- this.event = {};
- },
- methods: {
- // 查询数据
- getData() {
- getOrderBillsPlansByid(this.orderNo).then(res => {
- res.data.loadQty == 0 ? res.data.loadQty = null : res.data.loadQty
- res.data.unLoadQty == 0 ? res.data.unLoadQty = null : res.data.unLoadQty
- res.data.odometerstart == 0 ? res.data.odometerstart = null : res.data.odometerstart
- res.data.odometerend == 0 ? res.data.odometerend = null : res.data.odometerend
- res.data.detourEmptyMile == 0 ? res.data.detourEmptyMile = null : res.data.detourEmptyMile
- res.data.detourLoadMile == 0 ? res.data.detourLoadMile = null : res.data.detourLoadMile
- if (res.data.ifDetour == "T") {
- this.detour.push("行程绕路")
- }
- for (let role of res.data.roleList) {
- if (role == 'DZ') {
- this.disabled = true;
- }
- if (role == 'JSY') {
- this.disabled = false;
- }
- }
- // // 审核中
- // if (res.data.ifStarted == "S") {
- // this.disabled = true;
- // }
- // // 审核完成
- // if (res.data.ifStarted == "A") {
- // this.disabled = true;
- // }
-
- // 提交报账单
- if (res.data.ifOrder2ed == "S" || res.data.ifOrder2ed == "O") {
- this.disabled = true;
- }
- this.formData = res.data;
- this.fileList1 = res.data.fileList1;
- this.loading = false;
- if (this.status317 == 6) {
- this.disabled = true;
- }
- this.startDate = this.GetTime(60)
- })
- },
- // 切换
- change(item) {
- this.isTabs = item.name;
- },
- // 当天日期
- today(type) {
- if (this.disabled) {
- return
- }
- if (type == "ZC") {
- this.formData.loadDateString = Date.parse(new Date());
- } else if (type == "XC") {
- this.formData.unLoadDateString = Date.parse(new Date());
- }
- },
- // 数据校验
- dataVerify() {
- if (this.formData.loadQty == '' || this.formData.loadQty == null || this.formData.loadQty == '0') {
- this.$refs.uToast.show({
- type: 'warning',
- icon: false,
- message: "请输入装车吨位!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- })
- } else if (this.formData.loadDateString == '' || this.formData.loadDateString == null) {
- this.$refs.uToast.show({
- type: 'warning',
- icon: false,
- message: "请选择装车时间!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- })
- } else if (this.formData.unLoadQty == '' || this.formData.unLoadQty == null || this.formData.unLoadQty == '0') {
- this.$refs.uToast.show({
- type: 'warning',
- icon: false,
- message: "请输入卸车吨位!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- })
- } else if (this.formData.unLoadDateString == '' || this.formData.unLoadDateString == null) {
- this.$refs.uToast.show({
- type: 'warning',
- icon: false,
- message: "请选择卸车时间!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- })
- }
- else if (this.fileList1.length < 2) {
- return this.$refs.uToast.show({
- type: 'warning',
- icon: false,
- message: "图片最少两张!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- })
- }
- else {
- return 'ok';
- }
- },
- // 提交里程点击事件
- disabledClick() {
-
- if(this.formData.loadQty == null || this.formData.loadQty == 0) {
- this.$refs.uToast.show({
- type: 'warning',
- icon: false,
- message: "请输入装车吨位!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- })
- } else {
- this.submitShow = true
- }
-
- // if (this.status317 == 2 && this.dataVerify() == 'ok') {
- // if (this.dataVerify() == 'ok') {
- // this.submitShow = true
- // } else {
- // this.$refs.uToast.show({
- // type: 'warning',
- // icon: false,
- // message: "不允许保存!",
- // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- // })
- // }
- },
- // 提交报账单数据校验
- upDisabledClick() {
- if(this.dataVerify() === 'ok') {
- this.upCancel = true
- }
- },
- // 行程绕路点击事件
- checkboxChange() {
- if (this.detour.length > 0) {
- this.formData.detourEmptyMile = null
- this.formData.detourLoadMile = null
- this.formData.detourDesc = ""
- }
- },
- // 保存订单
- setOrderBillsPlansByid(id) {
- this.formData.loadQty = this.formData.loadQty == null || this.formData.loadQty == '' ? 0 : this.formData.loadQty
- this.formData.unLoadQty = this.formData.unLoadQty == null || this.formData.unLoadQty == '' ? 0 : this.formData.unLoadQty
-
- if(this.formData.loadDateString != null && this.formData.loadDateString != '') {
- this.formData.loadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.loadDateString))
- } else {
- this.formData.loadDateString = null
- }
-
- if(this.formData.unLoadDateString != null && this.formData.unLoadDateString != '') {
- this.formData.unLoadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.unLoadDateString))
- } else {
- this.formData.unLoadDateString = null
- }
-
-
- this.formData.odometerstart = this.formData.odometerstart == null || this.formData.odometerstart == '' ? 0 : this.formData.odometerstart
- this.formData.odometerend = this.formData.odometerend == null || this.formData.odometerend == '' ? 0 : this.formData.odometerend
- this.formData.loadmile = this.formData.loadmile == null || this.formData.loadmile == '' ? 0 : this.formData.loadmile
- // 行程绕路赋值
- if (this.detour.length > 0) {
- this.formData.ifDetour = "T"
- } else {
- this.formData.ifDetour = "F"
- }
-
- this.formData.detourEmptyMile = this.formData.detourEmptyMile == null || this.formData.detourEmptyMile == '' ? 0 : this.formData.detourEmptyMile
- this.formData.detourLoadMile = this.formData.detourLoadMile == null || this.formData.detourLoadMile == '' ? 0 : this.formData.detourLoadMile
- this.formData.detourDesc = this.formData.detourDesc == null ? '' : this.formData.detourDesc
- putOrderBillsPlansByid(this.formData).then(ress => {
- if (ress.code == 200) {
- getOrderBillsPlansByid(this.orderNo).then(res => {
-
- res.data.loadQty == 0 ? res.data.loadQty = null : res.data.loadQty
- res.data.unLoadQty == 0 ? res.data.unLoadQty = null : res.data.unLoadQty
- res.data.odometerstart == 0 ? res.data.odometerstart = null : res.data.odometerstart
- res.data.odometerend == 0 ? res.data.odometerend = null : res.data.odometerend
- res.data.loadmile == 0 ? res.data.loadmile = null : res.data.loadmile
- res.data.detourEmptyMile == 0 ? res.data.detourEmptyMile = null : res.data.detourEmptyMile
- res.data.detourLoadMile == 0 ? res.data.detourLoadMile = null : res.data.detourLoadMile
-
- if (res.data.ifDetour == "T") {
- this.detour.push("行程绕路")
- }
-
- for (let role of res.data.roleList) {
- if (role.roleKey == 'DZ') {
- this.disabled = true;
- }
- }
-
- // // 审核中
- // if (res.data.ifStarted == "S") {
- // this.disabled = true;
- // }
- // // 审核完成
- // if (res.data.ifStarted == "A") {
- // this.disabled = true;
- // }
-
- // 提交报账单
- if (res.data.ifOrder2ed == "S" || res.data.ifOrder2ed == "O") {
- this.disabled = true;
- }
-
- this.formData = res.data;
- this.fileList1 = res.data.fileList1;
- this.loading = false;
-
- if (this.status317 == 6) {
- this.disabled = true;
- }
- this.startDate = this.GetTime(60)
-
- this.submitShow = false
-
- // 保存成功弹窗提示
- this.$refs.uToast.show({
- type: 'success',
- message: "保存成功!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
- })
- })
-
- } else {
- // 保存失败消息
- this.$refs.uToast.show({
- icon: false,
- message: "保存失败请重试!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
- })
- }
- })
- },
- // 提交单据
- upReceipts() {
- this.loading = true;
- this.formData.loadQty = this.formData.loadQty == null || this.formData.loadQty == '' ? 0 : this.formData.loadQty
- this.formData.unLoadQty = this.formData.unLoadQty == null || this.formData.unLoadQty == '' ? 0 : this.formData.unLoadQty
-
- if(this.formData.loadDateString != null && this.formData.loadDateString != '') {
- this.formData.loadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.loadDateString))
- } else {
- this.formData.loadDateString = null
- }
- //
- if(this.formData.unLoadDateString != null && this.formData.unLoadDateString != '') {
- this.formData.unLoadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.unLoadDateString))
- } else {
- this.formData.unLoadDateString = null
- }
-
-
- this.formData.odometerstart = this.formData.odometerstart == null || this.formData.odometerstart == '' ? 0 : this.formData.odometerstart
- this.formData.odometerend = this.formData.odometerend == null || this.formData.odometerend == '' ? 0 : this.formData.odometerend
- this.formData.loadmile = this.formData.loadmile == null || this.formData.loadmile == '' ? 0 : this.formData.loadmile
-
- // 行程绕路赋值
- if (this.detour.length > 0) {
- this.formData.ifDetour = "T"
- this.formData.detourEmptyMile = this.formData.detourEmptyMile == null || this.formData.detourEmptyMile == '' ? 0 : this.formData.detourEmptyMile
- this.formData.detourLoadMile = this.formData.detourLoadMile == null || this.formData.detourLoadMile == '' ? 0 : this.formData.detourLoadMile
- } else {
- this.formData.ifDetour = "F"
- }
-
- putOrderBillsPlansByid(this.formData).then(ress => {
- if (ress.code == 200) {
- // 提交订单
- // actId entityId
- upReceipts(this.orderNo,{actId:this.formData.actId,entityId:this.formData.entityId}).then(res => {
- // 提交报账单成功
- this.$refs.uToast.show({
- type: 'success',
- message: "提交报账单成功!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
- })
- })
- // 获取详情数据
- getOrderBillsPlansByid(this.orderNo).then(res => {
-
- res.data.loadQty == 0 ? res.data.loadQty = null : res.data.loadQty
- res.data.unLoadQty == 0 ? res.data.unLoadQty = null : res.data.unLoadQty
- res.data.odometerstart == 0 ? res.data.odometerstart = null : res.data.odometerstart
- res.data.odometerend == 0 ? res.data.odometerend = null : res.data.odometerend
- res.data.loadmile == 0 ? res.data.loadmile = null : res.data.loadmile
- res.data.detourEmptyMile == 0 ? res.data.detourEmptyMile = null : res.data.detourEmptyMile
- res.data.detourLoadMile == 0 ? res.data.detourLoadMile = null : res.data.detourLoadMile
-
- if (res.data.ifDetour == "T") {
- this.detour.push("行程绕路")
- }
-
- for (let role of res.data.roleList) {
- if (role.roleKey == 'DZ') {
- this.disabled = true;
- }
- }
-
- // 审核中
- // if (res.data.ifStarted == "S") {
- // this.disabled = true;
- // }
- // // 审核完成
- // if (res.data.ifStarted == "A") {
- // this.disabled = true;
- // }
-
- // 提交报账单
- if (res.data.ifOrder2ed == "S" || res.data.ifOrder2ed == "O") {
- this.disabled = true;
- }
-
- this.formData = res.data;
- this.fileList1 = res.data.fileList1;
- this.loading = false;
-
- if (this.status317 == 6) {
- this.disabled = true;
- }
- this.startDate = this.GetTime(60)
-
- this.upCancel = false
-
- // upReceipts(this.orderNo).then(res => {
- // console.log(res,'662');
- // // 提交报账单成功
- // this.$refs.uToast.show({
- // type: 'success',
- // message: "提交报账单成功!",
- // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
- // })
- // })
-
- })
-
- } else {
- // 提交报账单失败
- this.$refs.uToast.show({
- icon: false,
- message: "提交失败请重试!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
- })
- }
- })
- this.loading = false;
- },
- // 点击拨打电话
- telFun() {
- if (this.formData.driver1mobile != null && this.formData.driver1mobile != '') {
- uni.makePhoneCall({
- phoneNumber: this.formData.driver1mobile, //电话号码
- success: function(e) {
- // console.log(e);
- },
- fail: function(e) {
- // console.log(e);
- }
- })
- }
- },
- // 时间计算
- GetTime(sky) {
- var date = new Date();
- var base = Date.parse(date); // 转换为时间戳
- var year = date.getFullYear(); //获取当前年份
- var mon = date.getMonth() + 1; //获取当前月份
- var day = date.getDate(); //获取当前日
- var oneDay = 24 * 3600 * 1000
- for (var i = 1; i < sky; i++) { //前sky天的时间
- var now = new Date(base -= oneDay);
- var myear = now.getFullYear();
- var month = now.getMonth() + 1;
- var mday = now.getDate()
- if (i == sky - 1) {
- var dataSky = [myear, month >= 10 ? month : '0' + month, mday >= 10 ? mday : '0' + mday]
- .join('-')
- return dataSky
- // + " 00:00:00"
- }
- }
- },
- // 删除图片
- deletePic(event) {
- if (this.formData.ifOrder2ed == 'S' || this.formData.ifOrder2ed == 'O') {
- this.$refs.uToast.show({
- type: 'warning',
- icon: false,
- message: "不允许修改!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- })
- } else {
- for (let role of this.formData.roleList) {
- if (role == 'JSY') {
- this.event = event;
- this.deleteShow = true;
- }
- }
- }
- },
- deleteImg() {
- var event = this.event;
- var url = event.file.url;
- var index = url.lastIndexOf("\/");
- var attachId = url.substring(index + 1, url.length);
- deleteTmsAttachMngs(attachId).then(res => {
- if (res.code == 200) {
- this[`fileList${event.name}`].splice(event.index, 1)
- // 删除成功消息
- this.$refs.uToast.show({
- type: 'success',
- message: "删除成功!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
- })
- } else {
- // 删除失败消息
- this.$refs.uToast.show({
- icon: false,
- message: "删除失败请重试!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
- })
- }
- this.event = {};
- this.deleteShow = false;
- })
- },
- // 新增图片
- imgUploading(event) {
- // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
- let lists = [].concat(event.file)
- let fileListLen = this[`fileList${event.name}`].length
- lists.map((item) => {
- this[`fileList${event.name}`].push({
- ...item,
- status: 'uploading',
- message: '上传中'
- })
- })
- for (let i = 0; i < lists.length; i++) {
- let date = this.dateToString("yyyyMMdd");
- let dateHHmmss = this.dateToString("yyyy-MM-dd HH:mm:ss");
- this.formData.date = date;
- insertTmsAttachMngs(this.formData).then(res => {
- if (res.code == 200) {
- uni.compressImage({
- src: lists[i].url,
- quality: 80,
- complete: ress => {
- let data = {
- name: 'avatarfile',
- filePath: ress.tempFilePath
- }
- // 获取经纬度
- let longitude = '';
- let latitude = '';
- uni.getLocation({
- type: 'wgs84',
- isHighAccuracy: true,
- geocode: true,
- fail: () => {
- this.fileList1.pop();
- this.$refs.uToast.show({
- type: 'warning',
- icon: false,
- message: "请打开定位!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- })
- return
- },
- success: (map) => {
- longitude = map.longitude
- latitude = map.latitude
- let dataForm = {
- attachId: res.data,
- longitude: longitude,
- latitude: latitude,
- updateDate: dateHHmmss,
- carRegNo:this.formData.carRegNo
- }
- // 上传图片
- pictureUploading(data, dataForm).then(res => {
- let item = this[`fileList${event.name}`][fileListLen]
- this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(
- item, {
- status: 'success',
- message: '',
- url: res.data
- }))
- fileListLen++
- })
- },
- });
-
- }
- })
-
- }
- })
- }
- },
- dateToString(fmt) {
- var date = new Date();
- var o = {
- "M+": date.getMonth() + 1, //月份
- "d+": date.getDate(), //日
- "H+": date.getHours(), //小时
- "m+": date.getMinutes(), //分
- "s+": date.getSeconds(), //秒
- "q+": Math.floor((date.getMonth() + 3) / 3), //季度
- "S": date.getMilliseconds() //毫秒
- };
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1
- .length));
- for (var k in o)
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ?
- (o[
- k]) : (("00" + o[k]).substr(("" + o[k]).length)));
- return fmt;
- },
- dateToStringS(fmt, date) {
- var o = {
- "M+": date.getMonth() + 1, //月份
- "d+": date.getDate(), //日
- "H+": date.getHours(), //小时
- "m+": date.getMinutes(), //分
- "s+": date.getSeconds(), //秒
- "q+": Math.floor((date.getMonth() + 3) / 3), //季度
- "S": date.getMilliseconds() //毫秒
- };
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1
- .length));
- for (var k in o)
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ?
- (o[
- k]) : (("00" + o[k]).substr(("" + o[k]).length)));
- return fmt;
- },
- uploadFilePromise(url) {
- insertTmsAttachMngs(this.formData).then(res => {
- if (res.code != 200) {
- return null;
- }
- let data = {
- name: 'avatarfile',
- filePath: url
- }
- let dataForm = {
- attachId: res.data
- }
- pictureUploading(data, dataForm).then(res => {
- return res.data.data;
- })
- })
- },
- // 跳转报销费用页面
- skipClaimExpense() {
- uni.navigateTo({
- url: '/pages/particulars/claimExpense/index?orderNo=' + this.orderNo + '&status376=' +
- this
- .status376,
- });
- },
- // 跳转注意事项
- attention() {
- uni.navigateTo({
- url: '/pages/particulars/attention/index?remarks=' + this.formData.remarks,
- });
- },
- //输入框小数
- checkLoadQty(e) {
- //正则表达试
- e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.formData.loadQty = e.target.value
- })
- },
- checkUnLoadQty(e) {
- //正则表达试
- e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.formData.unLoadQty = e.target.value
- })
- },
- checkUnLoadmile(e) {
- //正则表达试
- e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.formData.loadmile = e.target.value
- })
- },
- checkUnDetourEmptyMile(e) {
- //正则表达试
- e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.formData.detourEmptyMile = e.target.value
- })
- },
- checkUnDetourLoadMile(e) {
- //正则表达试
- e.target.value = (e.target.value.match(/^\d*(\.?\d{0,3})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.formData.detourLoadMile = e.target.value
- })
-
- }
- }
- }
- </script>
- <style lang="scss">
- @import url("/font/iconfont.css");
-
- // 当天按钮样式
- .today {
- width: 80rpx;
- height: 60rpx;
- background-color: #3c9cff;
- color: #fff;
- border-radius: 80rpx;
-
- text-align: center;
- line-height: 60rpx;
- }
- // 修改布局方向为纵向布局
- .vertical-layout {
- display: flex;
- }
- .textAlign {
- text-align: right;
- // margin-left: 20rpx;
- }
- // 分割线
- .striping {
- width: 100%;
- height: 4rpx;
- background-color: #f0f0f0f0;
- }
- .box-box {
- padding-left: 30rpx;
- padding-right: 30rpx;
- }
- .a-blue {
- color: #3c9cff;
- }
- .content {
- // box-sizing: border-box;
- background-color: white;
- .head-no {
- // border-radius: 0 0 40rpx 40rpx;
- // width: 960rpx;
- // height: 100rpx;
- height: 40rpx;
- padding: 0 30rpx;
- color: #fff;
- vertical-align: middle;
- display: flex;
- // align-items: center;
- align-items: flex-end;
-
- justify-content: space-between;
- box-sizing: border-box;
- font-size: 34rpx;
- font-weight: 700;
- background-color: #3c9cff;
- }
- .head-no-addr {
- // width: 960rpx;
- height: 100rpx;
- // padding-left: 30rpx;
- padding: 0 30rpx;
- vertical-align: middle;
- color: #fff;
- font-size: 34rpx;
- font-weight: 700;
- display: flex;
- align-items: center;
- justify-content: space-between;
- box-sizing: border-box;
- background-color: #3c9cff;
- }
- .head {
- // width: 100%;
- height: 100rpx;
- padding-left: 30rpx;
- vertical-align: middle;
- display: table-cell;
- font-size: 34rpx;
- font-weight: 900;
- // background-color: red;
- }
- .box-two {
- color: #3b3b3b;
- overflow: hidden;
- height: 100rpx;
- // border-bottom: 2rpx solid #f0f0f0f0;
- padding-left: 20rpx;
- margin-right: 20rpx;
- // font-size: 30rpx;
- display: flex;
- align-items: center;
- .key {
- display: inline-block;
- width: 24%;
- color: #3c9cff;
- // font-weight: 700;
- }
- .value {
- margin-left: 20rpx;
- // color: #787878;
- color: #3b3b3b;
- margin-right: 20rpx;
- }
- .value-two {
- width: calc(100% - 24%);
- color: #3b3b3b;
- // margin-right: 20rpx;
- border-bottom: 2rpx dotted #000;
- }
- }
- .box {
- color: #3b3b3b;
- overflow: hidden;
- height: 100rpx;
- // border-bottom: 2rpx solid #f0f0f0f0;
- padding-left: 20rpx;
- // font-size: 30rpx;
- display: flex;
- align-items: center;
- .data {
- width: 50%;
- height: 100%;
- // background-color: pink;
- display: flex;
- align-items: center;
- .key {
- // background-color: indianred;
- width: 100%;
- color: #3c9cff;
- }
- .key-date {
- width: 40%;
- }
- .value {
- margin-right: 20rpx;
- border-bottom: 2rpx dotted #000;
- // color: rgb(144, 147, 153);
- color: #3b3b3b;
- }
- }
- }
- .bottom {
- position: fixed;
- bottom: calc(var(--window-bottom));
- width: 100%;
- height: 130rpx;
- background-color: white;
- .row {
- display: flex;
- justify-content: space-evenly;
- height: 130rpx;
- align-items: center;
- .button {
- // width: 300rpx;
- width: 660rpx;
- }
- }
- }
- .attention {
- padding: 30rpx;
- padding-left: 50rpx;
- padding-bottom: 40rpx;
- background-color: #f0f0f0f0;
- }
- .cushion {
- width: 100%;
- height: 104rpx;
- background-color: #f0f0f0f0;
- }
- }
- </style>
|