1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177 |
- <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'}" 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;">单据拍照存档</text>
- </view>
- <u-upload :fileList="fileList1" accept="image" :sizeType="['compressed']" capture="camera"
- @afterRead="imgUploading" @delete="deletePic" name="1" multiple :previewFullImage="true"
- ></u-upload>
- <!-- :disabled="disabled" -->
- </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;" v-if="formData.ifStarted != 'A'">
- <view class="row" v-if="formData.ifLoaded == 'T' && (formData.ifUnLoaded == 'T' || formData.ifUnLoaded == 'F') && 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.ifLoaded == "T" &&
- res.data.ifUnLoaded == "T" &&
- res.data.ifStarted == "S") {
- this.disabled = true;
- }
- // 审核完成
- if (res.data.ifLoaded == "T" &&
- res.data.ifUnLoaded == "T" &&
- 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.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
- }
- },
- // 保存订单
- 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"
- 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) {
- 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.ifLoaded == "T" &&
- res.data.ifUnLoaded == "T" &&
- res.data.ifStarted == "S") {
- this.disabled = true;
- }
- // 审核完成
- if (res.data.ifLoaded == "T" &&
- res.data.ifUnLoaded == "T" &&
- 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) {
- 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.ifLoaded == "T" &&
- res.data.ifUnLoaded == "T" &&
- res.data.ifStarted == "S") {
- this.disabled = true;
- }
- // 审核完成
- if (res.data.ifLoaded == "T" &&
- res.data.ifUnLoaded == "T" &&
- 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 => {
-
- // 提交报账单成功
- 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.status317 == 6) {
- this.$refs.uToast.show({
- type: 'warning',
- icon: false,
- message: "不允许修改!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- })
- } else if (this.status317 == 2) {
- 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) {
- let data = {
- name: 'avatarfile',
- filePath: lists[i].url
- }
- // 获取经纬度
- let longitude = '';
- let latitude = '';
- uni.getLocation({
- type: 'wgs84',
- isHighAccuracy: true,
- geocode: true,
- success: (res) => {
- longitude = res.longitude
- latitude = res.latitude
- console.log('当前位置的经度:' + res.longitude);
- console.log('当前位置的纬度:' + res.latitude);
- }
- });
- let dataForm = {
- attachId: res.data,
- longitude: longitude,
- latitude: latitude,
- updateDate: dateHHmmss
- }
- // 上传图片
- 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>
|