123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662 |
- <template>
- <view class="content">
- <view class="head-no a-blue">
- <text>订单号: {{formData.orderNo}}</text>
- </view>
- <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-collapse :value="['Declaration information']"> -->
- <u-collapse ref="xxxxxx111">
- <!-- <u-collapse-item title="报单信息" name="Declaration information"> -->
- <view class="box-box">
- <!-- <view class="box">
- <view class="data">
- <text class="key">装车吨位</text>
- <input class="value" :disabled="disabled" inputmode="decimal" @input="checkLoadQty"
- v-model="formData.loadQty" />
- </view>
- <view class="data">
- <text class="key-date">装车时间</text>
- <uni-datetime-picker class="value" :disabled="disabled"
- v-model="formData.loadDateString">{{formData.loadDateString == null ? "请选择日期" : formData.loadDateString }}</uni-datetime-picker>
- </view>
- </view> -->
- <view class="box-two">
- <text class="key">装车吨位</text>
- <input class="value-two" :disabled="disabled" inputmode="decimal" @input="checkLoadQty"
- v-model="formData.loadQty" />
- </view>
- <view class="box-two">
- <text class="key">装车时间</text>
- <uni-datetime-picker class="value-two" :disabled="disabled"
- v-model="formData.loadDateString">{{formData.loadDateString == null ? "请选择日期" : formData.loadDateString }}</uni-datetime-picker>
- </view>
- <!-- <view class="box">
- <view class="data">
- <text class="key">卸车吨位</text>
- <input class="value" :disabled="disabled" inputmode="decimal" @input="checkUnLoadQty"
- v-model="formData.unLoadQty" />
- </view>
- <view class="data">
- <text class="key-date">卸车时间</text>
- <uni-datetime-picker class="value" :disabled="disabled"
- v-model="formData.unLoadDateString">{{formData.unLoadDateString == null ? "请选择日期" : formData.unLoadDateString }}</uni-datetime-picker>
- </view>
- </view> -->
- <view class="box-two">
- <text class="key">卸车吨位</text>
- <input class="value-two" :disabled="disabled" inputmode="decimal" @input="checkUnLoadQty"
- v-model="formData.unLoadQty" />
- </view>
- <view class="box-two">
- <text class="key">卸车时间</text>
- <uni-datetime-picker class="value-two" :disabled="disabled"
- v-model="formData.unLoadDateString">{{formData.unLoadDateString == null ? "请选择日期" : formData.unLoadDateString }}</uni-datetime-picker>
- </view>
- <view class="box">
- <view class="data">
- <text class="key">空载起点</text>
- <input class="value" :disabled="disabled" v-model="formData.emptyaddr1" />
- </view>
- <view class="data">
- <text class="key">空车里程</text>
- <input class="value" :disabled="disabled" inputmode="decimal"
- v-model="formData.odometerstart" />
- </view>
- </view>
- <view class="box">
- <view class="data">
- <text class="key">空载终点</text>
- <input class="value" :disabled="disabled" v-model="formData.emptyaddr2" />
- </view>
- <view class="data">
- <text class="key">空车里程</text>
- <input class="value" :disabled="disabled" inputmode="decimal" v-model="formData.odometerend" />
- </view>
- </view>
- <view class="box-two">
- <text class="key">重车里程</text>
- <input class="value-two" :disabled="disabled" inputmode="decimal" @input="checkUnLoadmile"
- v-model="formData.loadmile" />
- </view>
- <view class="box-two">
- <text class="key">备 注</text>
- <input class="value-two" :disabled="disabled" v-model="formData.driverassdesc" />
- </view>
- </view>
- <!-- </u-collapse-item> -->
- <u-collapse-item title="照片" name="img" ref="collapseHeight">
- <!-- @afterRead="imgUploading" -->
- <u-upload :fileList="fileList1" @delete="deletePic" name="1" multiple :previewFullImage="true"
- :disabled="this.status317 == 2"></u-upload>
- </u-collapse-item>
- <u-collapse-item title="订单信息" name="order information">
- <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>
- </u-collapse-item>
- </u-collapse>
- <view class="attention">
- <text class="text-grey1">请查看</text>
- <text @click="attention()" class="text-blue">注意事项</text>
- </view>
- <view class="cushion">
- </view>
- <view class="bottom vertical-layout">
- <view class="onsubmit-script" @click="setOrderBillsPlansByid()">
- <text v-if="status317 == 2">提交里程</text>
- <text v-if="status317 == 6 || status317 == 0">里程信息</text>
- </view>
- <view class="claim-expense" @click="skipClaimExpense()">
- <text v-if="status376 == 2">报销费用</text>
- <text v-if="status376 == 6 || status376 == 0">查看报销</text>
- </view>
- </view>
- <!-- 遮盖罩 -->
- <u-loading-page :loading="loading"></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>
- </view>
- </template>
- <script>
- import {
- getOrderBillsPlansByid,
- putOrderBillsPlansByid,
- insertTmsAttachMngs,
- pictureUploading,
- deleteTmsAttachMngs
- } from "@/api/particulars"
- export default {
- data() {
- return {
- // 遮盖罩
- loading: true,
- formData: {},
- // 表单验证
- rules: {
- loadQty: '',
- loadDateString: '',
- unLoadQty: '',
- unLoadDateString: '',
- emptyaddr1: '',
- odometerstart: '',
- emptyaddr2: '',
- odometerend: '',
- loadmile: '',
- remarks: ''
- },
- orderNo: '',
- // 照片
- fileList1: [],
- // 删除弹框
- deleteShow: false,
- // 删除的图片
- event: {},
- // 输入框禁用
- disabled: false,
- status317: 0,
- status376: 0
- };
- },
- onLoad: function(option) {
- this.status317 = option.status317;
- this.status376 = option.status376;
- getOrderBillsPlansByid(option.orderNo).then(res => {
- this.orderNo = option.orderNo;
- this.formData = res.data;
- this.fileList1 = res.data.fileList1;
- this.loading = false;
- if (res.data.billStatus == 6) {
- this.disabled = true;
- }
- })
- },
- onUnload() {
- this.formData = {};
- this.loading = true;
- this.event = {};
- },
- methods: {
- // 保存订单
- setOrderBillsPlansByid(id) {
- // console.log(this.status317);
- if (this.status317 == 2) {
- if (this.formData.unLoadQty == '' || this.formData.unLoadQty == null) {
- 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.formData.loadmile == '' || this.formData.loadmile == null) {
- this.$refs.uToast.show({
- type: 'warning',
- icon: false,
- message: "请输入重车里程!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- })
- } else {
- putOrderBillsPlansByid(this.formData).then(res => {
- if (res.code == 200) {
- // 保存成功弹窗提示
- 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'
- })
- }
- })
- }
- } else {
- // this.$refs.uToast.show({
- // type: 'warning',
- // icon: false,
- // message: "不允许保存!",
- // iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- // })
- }
- },
- // 点击拨打电话
- 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);
- }
- })
- }
- },
- // 删除图片
- deletePic(event) {
- if (this.formData.status376 == 6) {
- this.$refs.uToast.show({
- type: 'warning',
- icon: false,
- message: "不允许修改!",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
- })
- } else if (this.formData.status376 == 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) {
- this.$nextTick(() => {
- this.$refs.xxxxxx111.init()
- })
- // 当设置 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++) {
- insertTmsAttachMngs(this.formData).then(res => {
- if (res.code == 200) {
- let data = {
- name: 'avatarfile',
- filePath: lists[i].url
- }
- let dataForm = {
- attachId: res.data
- }
- pictureUploading(data, dataForm).then(res => {
- let item = this[`fileList${event.name}`][fileListLen]
- // console.log("item");
- // console.log(item);
- this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(
- item, {
- status: 'success',
- message: '',
- url: res.data.data
- }))
- fileListLen++
- })
- }
- })
- }
- },
- 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
- })
- }
- }
- }
- </script>
- <style lang="scss">
- // 修改布局方向为纵向布局
- .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: 500rpx;
- height: 100rpx;
- padding-left: 30rpx;
- vertical-align: middle;
- display: table-cell;
- font-size: 34rpx;
- font-weight: 900;
- // 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: 80rpx;
- background-color: pink;
- text-align: center;
- line-height: 80rpx;
- background-color: #f0f0f0f0;
- color: #f0f0f0f0;
- // font-weight: bold;
- font-size: 35rpx;
- .onsubmit-script {
- width: 50%;
- height: 100%;
- border-left: 2rpx solid #f0f0f0f0;
- border-right: 2rpx solid #f0f0f0f0;
- background-color: #0b68ffff;
- border-radius: 20rpx;
- }
- .claim-expense {
- width: 50%;
- height: 100%;
- border-left: 2rpx solid #f0f0f0f0;
- border-right: 2rpx solid #f0f0f0f0;
- background-color: #0b68ffff;
- border-radius: 20rpx;
- }
- .primary {
- background-color: #0b68ffff;
- }
- }
- .attention {
- padding: 30rpx;
- padding-left: 50rpx;
- padding-bottom: 40rpx;
- background-color: #f0f0f0f0;
- }
- .cushion {
- width: 100%;
- height: 104rpx;
- background-color: #f0f0f0f0;
- }
- }
- </style>
|