|
|
|
<template>
|
|
|
|
<BasicContainer ref="basicContainer" :option="option" :leftClick="backPreviousPage">
|
|
|
|
<template #head>
|
|
|
|
<view class="header">
|
|
|
|
<view class="headtop">
|
|
|
|
<view @click='showCalendar' class="inputsr flex1">
|
|
|
|
<view class="timeInput">
|
|
|
|
{{datatime|| '请选择时间'}}
|
|
|
|
</view>
|
|
|
|
<view @click.stop.prevent>
|
|
|
|
<u-icon @click='showCalendar' style="margin-right: 10upx;" v-if="!datatime" name="calendar"
|
|
|
|
color="#999999" size="50"></u-icon>
|
|
|
|
<u-icon @click="cleartime" style="margin-right: 10upx;" v-else name="close-circle" color="#999999"
|
|
|
|
size="40"></u-icon>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="headtop mt20">
|
|
|
|
<view class="input ">
|
|
|
|
<MyInput clearable v-model="details.scancode" placeholder="请扫描或输入车次号">
|
|
|
|
|
|
|
|
</MyInput>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view @click="init">查询</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="tabtip">
|
|
|
|
<view @click="setstate(1)">
|
|
|
|
<view :class="status==1?'xz':''">未发车</view>
|
|
|
|
</view>
|
|
|
|
<view @click="setstate(2)">
|
|
|
|
<view :class="status==2?'xz':''">已发车</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<template #body>
|
|
|
|
<view class="sccv" @scrolltolower="jiazai">
|
|
|
|
<view class="mabx">
|
|
|
|
<view v-for="item in dataList" :key="item" class="pb20">
|
|
|
|
<view class="topbox font-color">
|
|
|
|
<view class="type1">
|
|
|
|
<view>
|
|
|
|
<text>车次号:</text>
|
|
|
|
<text>{{item.carsNo}}</text>
|
|
|
|
</view>
|
|
|
|
<view>
|
|
|
|
<text>车牌:</text>
|
|
|
|
<text>{{item.carNumber}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="type1">
|
|
|
|
<view>
|
|
|
|
<text>总件数/装车件数:</text>
|
|
|
|
<text>{{item.planLoadingNumber + '/' + item.realLoadingNumber}}</text>
|
|
|
|
</view>
|
|
|
|
<view>
|
|
|
|
<text>车长:</text>
|
|
|
|
<text>{{''}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="type1">
|
|
|
|
<view>
|
|
|
|
<text>主驾司机:</text>
|
|
|
|
<text>{{item.driverName}}</text>
|
|
|
|
</view>
|
|
|
|
<view>
|
|
|
|
<text>电话:</text>
|
|
|
|
<text>{{item.driverMobile}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view>
|
|
|
|
<text>类型:</text>
|
|
|
|
<text>{{details.loadType[item.loadType]}}</text>
|
|
|
|
</view>
|
|
|
|
<view>
|
|
|
|
<text>线路:</text>
|
|
|
|
<text>{{item.carsLineName}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<template v-if="status!==2">
|
|
|
|
<view class="bts">
|
|
|
|
|
|
|
|
<view class="btn" @click="gostockuplistBytray(item)">
|
|
|
|
整托装车
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="btn" @click="gostockuplist(item)">
|
|
|
|
按件装车
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view @click="handleShowImg(item)">
|
|
|
|
上传运输合同
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view @click="handleShowLoadImg(item, 'beforeLoad')">
|
|
|
|
上传装车前图片
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view @click="handleShowLoadImg(item, 'beforeStart')">
|
|
|
|
上传发车前图片
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<view :class="{tip:true, active: status==2}">
|
|
|
|
<view class="">
|
|
|
|
{{status==2? '已发车':'待发车'}}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="footer_button">
|
|
|
|
<view class="button" hover-class="active" @click="handleAddStowage">新增配载</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</BasicContainer>
|
|
|
|
|
|
|
|
<!-- 上传运输合同 -->
|
|
|
|
<PopUp ref="UploadImg">
|
|
|
|
<u-upload :fileList="details.imgFileList" @afterRead="(e) => handleUploadImg(e, details.imgFileList)"
|
|
|
|
@delete="(e)=>deletePic(e, details.imgFileList)" multiple></u-upload>
|
|
|
|
</PopUp>
|
|
|
|
|
|
|
|
<!-- 装车前上传 -->
|
|
|
|
<PopUp ref="LoadUploadImg">
|
|
|
|
<block v-for="item in details.imgOption" :key="item.title">
|
|
|
|
|
|
|
|
<view class="upload_img_item">
|
|
|
|
<view class="upload_img_item_title">
|
|
|
|
<view>
|
|
|
|
{{item.title}}
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view v-if="item.min" class="ml10" style="color: red; font-weight: normal">
|
|
|
|
最少{{item.min}}张
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<u-upload :fileList="item.imgArr" @afterRead="(e)=> handleUploadImg(e, item.imgArr)"
|
|
|
|
@delete="(e)=> deletePic(e, item.imgArr)" multiple></u-upload>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</block>
|
|
|
|
|
|
|
|
</PopUp>
|
|
|
|
|
|
|
|
<tips ref="tip"></tips>
|
|
|
|
<l-calendar v-model:value="show" :initStartDate='date[0]' :initEndDate='date[1]' @hide='showCalendar'
|
|
|
|
@change="onConfirm"></l-calendar>
|
|
|
|
<saomiao2 :ishidestop="scanState !== 0"></saomiao2>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import {
|
|
|
|
onLoad,
|
|
|
|
onShow,
|
|
|
|
onHide,
|
|
|
|
onUnload,
|
|
|
|
onPullDownRefresh
|
|
|
|
} from '@dcloudio/uni-app'
|
|
|
|
import { postCarsLoadPageList, postFindFinanceList, postAddContractByLoadId, postUploadLoadingPhoto, postUploadStartPhoto, } from '@/api/user.js'
|
|
|
|
import { timeType } from '@/interfaces/pagesHome/allType'
|
|
|
|
import functions from '@/utils/functions.js';
|
|
|
|
import { inject, reactive, ref, toRefs, watchEffect, nextTick } from "vue";
|
|
|
|
import utils from '@/utils/utils';
|
|
|
|
import useSystemSettingsStore from '@/store/useSystemSettingsStore';
|
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
|
const { scanState } = storeToRefs(useSystemSettingsStore())
|
|
|
|
const option = {
|
|
|
|
title: '配载装车',
|
|
|
|
haveData: true,
|
|
|
|
async pullDownRefreshInitPage() {
|
|
|
|
details.pageNum = 1
|
|
|
|
details.dataList.splice(0)
|
|
|
|
return await initpage()
|
|
|
|
},
|
|
|
|
reachBottomInitPage() {
|
|
|
|
return jiazai()
|
|
|
|
},
|
|
|
|
isFixed: true
|
|
|
|
}
|
|
|
|
let details = reactive({
|
|
|
|
datatime: '',
|
|
|
|
/** 页面渲染数组 */
|
|
|
|
dataList: [],
|
|
|
|
/** 未发车数据 */
|
|
|
|
NoTrainData: [],
|
|
|
|
/** 已发车数据 */
|
|
|
|
HaveLeftnData: [],
|
|
|
|
show: false,
|
|
|
|
pageNum: 1,
|
|
|
|
size: 10,
|
|
|
|
stockupDate: '',
|
|
|
|
status: 1,
|
|
|
|
loadType: {
|
|
|
|
'1': '干线',
|
|
|
|
'2': '支线',
|
|
|
|
'3': '专车',
|
|
|
|
},
|
|
|
|
imgFileList: [],
|
|
|
|
scancode: '',
|
|
|
|
notRefresh: false,
|
|
|
|
scrollHeight: '60vh',
|
|
|
|
/** 装车上传前配置 */
|
|
|
|
LoadUploadImgOption: [
|
|
|
|
{
|
|
|
|
title: '车厢卫生',
|
|
|
|
type: '10',
|
|
|
|
position: '2',
|
|
|
|
min: 1,
|
|
|
|
imgArr: []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
/** 发车前上传前配置 */
|
|
|
|
StartUploadImgOption: [
|
|
|
|
{
|
|
|
|
title: '盖雨棚前 - 左',
|
|
|
|
type: '20',
|
|
|
|
position: '3',
|
|
|
|
min: 1,
|
|
|
|
imgArr: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '盖雨棚前 - 右',
|
|
|
|
type: '20',
|
|
|
|
position: '4',
|
|
|
|
min: 1,
|
|
|
|
imgArr: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '盖雨棚前 - 后',
|
|
|
|
type: '20',
|
|
|
|
position: '2',
|
|
|
|
min: 1,
|
|
|
|
imgArr: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '盖雨棚后 - 左',
|
|
|
|
type: '21',
|
|
|
|
position: '3',
|
|
|
|
min: 1,
|
|
|
|
imgArr: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '盖雨棚后 - 右',
|
|
|
|
type: '21',
|
|
|
|
position: '4',
|
|
|
|
min: 1,
|
|
|
|
imgArr: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '盖雨棚后 - 后',
|
|
|
|
type: '21',
|
|
|
|
position: '2',
|
|
|
|
min: 1,
|
|
|
|
imgArr: [],
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
imgOption: [],
|
|
|
|
/** 已上传的图片 */
|
|
|
|
oldImgArr: []
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
// 上传图片 -- 弹窗 -- 运输合同
|
|
|
|
const UploadImg = ref()
|
|
|
|
|
|
|
|
/** 上传图片 -- 弹窗 -- 装车前上传 */
|
|
|
|
const LoadUploadImg = ref()
|
|
|
|
|
|
|
|
// 初始化页面展示未发车数据
|
|
|
|
details.dataList = details.NoTrainData
|
|
|
|
|
|
|
|
let tip = ref(null)
|
|
|
|
const basicContainer = ref(null)
|
|
|
|
const date = ref<number | string[]>([])
|
|
|
|
function showCalendar() {
|
|
|
|
details.show = !details.show
|
|
|
|
}
|
|
|
|
function onConfirm(e : any) {
|
|
|
|
console.log(e);
|
|
|
|
date.value[0] = e.startDate
|
|
|
|
date.value[1] = e.endDate
|
|
|
|
details.datatime = date.value[0] + ' 至 ' + date.value[1]
|
|
|
|
|
|
|
|
basicContainer.value.startPullDownRefresh()
|
|
|
|
}
|
|
|
|
|
|
|
|
onShow(async () => {
|
|
|
|
// 初始化关闭监听
|
|
|
|
uni.$off('scancodedate')
|
|
|
|
uni.$on('scancodedate', function (code) {
|
|
|
|
console.log('code :>> ', code);
|
|
|
|
if (code) {
|
|
|
|
console.log(code);
|
|
|
|
details.scancode = code
|
|
|
|
scandata()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
await nextTick()
|
|
|
|
if (!details.notRefresh) basicContainer.value.startPullDownRefresh()
|
|
|
|
})
|
|
|
|
onLoad(async () => {
|
|
|
|
date.value[0] = (uni as any).$u.timeFormat((new Date().valueOf() - 1000 * 60 * 60 * 24 * 3), 'yyyy-mm-dd')
|
|
|
|
date.value[1] = (uni as any).$u.timeFormat((new Date().valueOf()), 'yyyy-mm-dd')
|
|
|
|
details.datatime = date.value[0] + ' 至 ' + date.value[1]
|
|
|
|
// #ifdef APP
|
|
|
|
utils.ttsspke('请选择配载计划')
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
await nextTick()
|
|
|
|
details.scrollHeight = await utils.getViewDistanceFormTop('.sccv')
|
|
|
|
})
|
|
|
|
async function init() {
|
|
|
|
details.pageNum = 1
|
|
|
|
details.dataList.splice(0)
|
|
|
|
return initpage()
|
|
|
|
}
|
|
|
|
|
|
|
|
const handleSearch = () => {
|
|
|
|
basicContainer.value.startPullDownRefresh()
|
|
|
|
}
|
|
|
|
|
|
|
|
function jiazai() {
|
|
|
|
details.pageNum++
|
|
|
|
initpage()
|
|
|
|
}
|
|
|
|
|
|
|
|
function scandata() {
|
|
|
|
basicContainer.value.startPullDownRefresh()
|
|
|
|
}
|
|
|
|
|
|
|
|
/** 扫描 */
|
|
|
|
const handleScan = () => {
|
|
|
|
details.notRefresh = true
|
|
|
|
|
|
|
|
console.log('details.notRefresh :>> ', details.notRefresh);
|
|
|
|
uni.scanCode({
|
|
|
|
success(res) {
|
|
|
|
console.log('res :>> ', res);
|
|
|
|
details.scancode = res.result
|
|
|
|
scandata()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
async function initpage() {
|
|
|
|
if (date.value.length === 0) return utils.handleToast('请选择时间')
|
|
|
|
|
|
|
|
try {
|
|
|
|
uni.showLoading({
|
|
|
|
title: '数据加载中',
|
|
|
|
mask: true
|
|
|
|
})
|
|
|
|
let data = {
|
|
|
|
pageNum: details.pageNum,
|
|
|
|
pageSize: details.size,
|
|
|
|
startDate: date.value[0],
|
|
|
|
endDate: date.value[1],
|
|
|
|
type: details.status,
|
|
|
|
carsNo: details.scancode
|
|
|
|
}
|
|
|
|
let response = await postCarsLoadPageList(data)
|
|
|
|
if (response.code !== 200 || !response.data) return
|
|
|
|
|
|
|
|
if (details.pageNum > 1) {
|
|
|
|
if (response.data.records.length == 0) {
|
|
|
|
uni.showToast({
|
|
|
|
title: '已经到底了。',
|
|
|
|
icon: 'none'
|
|
|
|
})
|
|
|
|
details.pageNum--
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data.type === 1) {
|
|
|
|
for (let item of response.data.records) {
|
|
|
|
details.NoTrainData.push(item)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (let item of response.data.records) {
|
|
|
|
details.HaveLeftnData.push(item)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (err) {
|
|
|
|
console.log('err :>> ', err);
|
|
|
|
//TODO handle the exception
|
|
|
|
} finally {
|
|
|
|
uni.hideLoading()
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function checktime(event : timeType) {
|
|
|
|
console.log(event);
|
|
|
|
details.datatime = (uni as any).$u.timeFormat(event.value, 'yyyy-mm-dd');
|
|
|
|
details.show = false
|
|
|
|
console.log(details.datatime);
|
|
|
|
}
|
|
|
|
/** 按件装车 */
|
|
|
|
function gostockuplist(item : any) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '/pagesHome/pages/StowageListDetails/StowageListDetails?id=' + item.id + '&type=' + 1
|
|
|
|
})
|
|
|
|
}
|
|
|
|
/** 按托装车 */
|
|
|
|
function gostockuplistBytray(item : any) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '/pagesHome/pages/StowageListDetails/StowageListDetails?id=' + item.id + '&type=' + 2
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/** 显示运输合同 */
|
|
|
|
const handleShowImg = async (item) => {
|
|
|
|
console.log('item :>> ', item);
|
|
|
|
const res = await postFindFinanceList({ loadId: item.id })
|
|
|
|
|
|
|
|
const { code, data } = res
|
|
|
|
|
|
|
|
if (code !== 200) return
|
|
|
|
|
|
|
|
details.imgFileList = []
|
|
|
|
|
|
|
|
UploadImg.value.setDetails({
|
|
|
|
title: '上传运输合同',
|
|
|
|
showPopUp: true,
|
|
|
|
async success() {
|
|
|
|
if (details.imgFileList.length === 0) return uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: '请上传图片再提交'
|
|
|
|
})
|
|
|
|
|
|
|
|
console.log('details.imgFileList :>> ', details.imgFileList);
|
|
|
|
|
|
|
|
const submitData = {
|
|
|
|
loadId: item.id,
|
|
|
|
url: details.imgFileList.map(val => val.url).join(','),
|
|
|
|
}
|
|
|
|
|
|
|
|
const res = await postAddContractByLoadId(submitData)
|
|
|
|
|
|
|
|
const { code, msg } = res
|
|
|
|
|
|
|
|
if (code !== 200) return
|
|
|
|
|
|
|
|
utils.handleToast(msg)
|
|
|
|
|
|
|
|
UploadImg.value.details.showPopUp = false
|
|
|
|
|
|
|
|
// basicContainer.value.startPullDownRefresh()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
const handleInitImg = (data, imgArr, cloneList) => {
|
|
|
|
if (utils.getObjType(data) !== 'array') return
|
|
|
|
if (utils.getObjType(imgArr) !== 'array') return
|
|
|
|
if (utils.getObjType(cloneList) !== 'array') return
|
|
|
|
|
|
|
|
console.log('imgArr :>> ', imgArr);
|
|
|
|
console.log('cloneList :>> ', cloneList);
|
|
|
|
|
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
|
const value = data[i]
|
|
|
|
|
|
|
|
for (let i = 0; i < imgArr.length; i++) {
|
|
|
|
const item = imgArr[i]
|
|
|
|
|
|
|
|
if (item.type + ' - ' + item.position !== value.type + ' - ' + item.position) continue
|
|
|
|
item.imgArr.push({ url: value.url })
|
|
|
|
cloneList.push({ url: value.url })
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/** 显示装车前上传图片 */
|
|
|
|
const handleShowLoadImg = (item, type) => {
|
|
|
|
const _oldImgArr = []
|
|
|
|
let title = ''
|
|
|
|
|
|
|
|
const { carsLoadLinePhotoEntities } = item
|
|
|
|
switch (type) {
|
|
|
|
case 'beforeLoad':
|
|
|
|
details.imgOption = utils.deepClone(details.LoadUploadImgOption)
|
|
|
|
title = '装车前照片'
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'beforeStart':
|
|
|
|
details.imgOption = utils.deepClone(details.StartUploadImgOption)
|
|
|
|
title = '发车前照片'
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
handleInitImg(carsLoadLinePhotoEntities, details.imgOption, _oldImgArr)
|
|
|
|
|
|
|
|
LoadUploadImg.value.setDetails({
|
|
|
|
title,
|
|
|
|
showPopUp: true,
|
|
|
|
async success() {
|
|
|
|
const submitData = {
|
|
|
|
loadId: item.id,
|
|
|
|
addUrlList: [],
|
|
|
|
removeUrlList: []
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < details.imgOption.length; i++) {
|
|
|
|
const value = details.imgOption[i]
|
|
|
|
console.log('value :>> ', value);
|
|
|
|
|
|
|
|
if (value.imgArr.length < value.min) return utils.handleToast(`${value.title}最少上传${value.min}张`)
|
|
|
|
for (let i = 0; i < value.imgArr.length; i++) {
|
|
|
|
const item = value.imgArr[i]
|
|
|
|
|
|
|
|
let isContinue = false
|
|
|
|
|
|
|
|
for (let i = 0; i < _oldImgArr.length; i++) {
|
|
|
|
const _val = _oldImgArr[i]
|
|
|
|
|
|
|
|
if (_val.url !== item.url) continue
|
|
|
|
isContinue = true
|
|
|
|
_oldImgArr.splice(i, 1)
|
|
|
|
break
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isContinue) continue
|
|
|
|
submitData.addUrlList.push({
|
|
|
|
type: value.type,
|
|
|
|
position: value.position,
|
|
|
|
url: item.url
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (let i = 0; i < _oldImgArr.length; i++) {
|
|
|
|
const value = _oldImgArr[i]
|
|
|
|
|
|
|
|
submitData.removeUrlList.push(value.id)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let res : any = {}
|
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
case 'beforeLoad':
|
|
|
|
res = await postUploadLoadingPhoto(submitData)
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'beforeStart':
|
|
|
|
res = await postUploadStartPhoto(submitData)
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const { code, msg } = res
|
|
|
|
|
|
|
|
if (code !== 200) return
|
|
|
|
|
|
|
|
utils.handleToast(msg)
|
|
|
|
|
|
|
|
LoadUploadImg.value.details.showPopUp = false
|
|
|
|
|
|
|
|
basicContainer.value.startPullDownRefresh()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/** 上传图片 */
|
|
|
|
const handleUploadImg = async (event, imgArr) => {
|
|
|
|
try {
|
|
|
|
uni.showLoading({
|
|
|
|
title: '上传中',
|
|
|
|
mask: true
|
|
|
|
})
|
|
|
|
|
|
|
|
const writeArr = ['jpg', 'jpeg', 'png']
|
|
|
|
const PromiseAll = []
|
|
|
|
|
|
|
|
for (let i = 0; i < event.file.length; i++) {
|
|
|
|
const item = event.file[i]
|
|
|
|
console.log('item :>> ', item);
|
|
|
|
// const type = item.name.split('.').slice(-1)[0]
|
|
|
|
|
|
|
|
let type = ''
|
|
|
|
|
|
|
|
item.url && (type = item.url.split('.').slice(-1)[0])
|
|
|
|
item.name && (type = item.name.split('.').slice(-1)[0])
|
|
|
|
|
|
|
|
|
|
|
|
if (writeArr.indexOf(type) === -1) continue
|
|
|
|
|
|
|
|
console.log('type :>> ', type);
|
|
|
|
|
|
|
|
PromiseAll.push(functions.upfile(item.url, false))
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const res = await Promise.all(PromiseAll)
|
|
|
|
|
|
|
|
console.log('res :>> ', res);
|
|
|
|
|
|
|
|
for (let i = 0; i < res.length; i++) {
|
|
|
|
const response = res[i]
|
|
|
|
|
|
|
|
const { link } = response
|
|
|
|
|
|
|
|
if (!link) continue
|
|
|
|
|
|
|
|
imgArr.push({ url: link })
|
|
|
|
}
|
|
|
|
} catch (err) {
|
|
|
|
console.log('err :>> ', err);
|
|
|
|
//TODO handle the exception
|
|
|
|
} finally {
|
|
|
|
uni.hideLoading()
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log('event :>> ', event);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/** 删除图片 */
|
|
|
|
const deletePic = (event, imgArr) => {
|
|
|
|
console.log('event :>> ', event);
|
|
|
|
|
|
|
|
imgArr.splice(event.index, 1)
|
|
|
|
}
|
|
|
|
|
|
|
|
function cleartime() {
|
|
|
|
// console.log(1231211);
|
|
|
|
details.datatime = ''
|
|
|
|
date.value = []
|
|
|
|
basicContainer.value.startPullDownRefresh()
|
|
|
|
}
|
|
|
|
|
|
|
|
function setstate(state : number) {
|
|
|
|
details.status = state
|
|
|
|
details.dataList = state === 1 ? details.NoTrainData : details.HaveLeftnData
|
|
|
|
basicContainer.value.startPullDownRefresh()
|
|
|
|
}
|
|
|
|
|
|
|
|
// 返回上一级页面
|
|
|
|
function backPreviousPage() {
|
|
|
|
uni.reLaunch({
|
|
|
|
url: '/pages/index/index'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/** 新增配载 */
|
|
|
|
const handleAddStowage = () => {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '/pagesHome/pages/AddStowage/AddStowage'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
const { datatime, dataList, show, status } = toRefs(details)
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import url("@/utils/style/common.scss");
|
|
|
|
|
|
|
|
.inputsr {
|
|
|
|
width: 400upx !important;
|
|
|
|
height: 64upx;
|
|
|
|
background: #F5F5F6;
|
|
|
|
border-radius: 8upx 8upx 8upx 8upx;
|
|
|
|
opacity: 1;
|
|
|
|
border: 2upx solid #EEEEEE;
|
|
|
|
padding: 16upx 18upx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding-right: 0;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
font-size: 26upx;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #092C4D;
|
|
|
|
|
|
|
|
>.timeInput {
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
flex: 1;
|
|
|
|
font-size: 26upx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.header {
|
|
|
|
background-color: #FFFFFF;
|
|
|
|
padding: 20upx 30upx;
|
|
|
|
width: 100vw;
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
.input {
|
|
|
|
height: 60upx;
|
|
|
|
background: #F5F5F6;
|
|
|
|
border-radius: 8upx;
|
|
|
|
opacity: 1;
|
|
|
|
border: 2upx solid #00000020;
|
|
|
|
padding: 4upx;
|
|
|
|
|
|
|
|
:deep(.input_container) {
|
|
|
|
border: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.headtop {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
>view:nth-of-type(1) {
|
|
|
|
width: 540upx;
|
|
|
|
border: 2upx solid #00000020;
|
|
|
|
padding: 10upx 20upx;
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
>input {
|
|
|
|
flex: 1;
|
|
|
|
font-size: 28upx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
>view:nth-of-type(2) {
|
|
|
|
width: 128upx;
|
|
|
|
height: 64upx;
|
|
|
|
background: var(--subjectColor);
|
|
|
|
border-radius: 8upx;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
font-size: 32upx;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #FFFFFF;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sccv {
|
|
|
|
width: 100%;
|
|
|
|
margin-top: 20upx;
|
|
|
|
|
|
|
|
.mabx {
|
|
|
|
width: 100%;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 20upx;
|
|
|
|
padding-top: 0upx;
|
|
|
|
|
|
|
|
>view {
|
|
|
|
width: 100%;
|
|
|
|
background: #FFFFFF;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
box-sizing: border-box;
|
|
|
|
border-bottom: 2upx solid #ebebeb;
|
|
|
|
background-color: #ffffff;
|
|
|
|
margin-bottom: 20upx;
|
|
|
|
border-radius: 8upx;
|
|
|
|
position: relative;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
>view:nth-last-child(2) {
|
|
|
|
border-bottom: none !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.topbox {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
padding: 24upx;
|
|
|
|
border-bottom: 2upx solid #EEEEEE;
|
|
|
|
|
|
|
|
>.type1 {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
margin-bottom: 20upx;
|
|
|
|
zoom: 0.9;
|
|
|
|
|
|
|
|
>view {
|
|
|
|
width: 50%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
>.type2 {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-around;
|
|
|
|
margin-bottom: 15upx;
|
|
|
|
font-size: 28upx;
|
|
|
|
color: #161616;
|
|
|
|
margin-top: 20upx;
|
|
|
|
|
|
|
|
>view {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
>view:nth-of-type(1) {
|
|
|
|
font-size: 28upx;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #092C4D;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:nth-of-type(1) {
|
|
|
|
>view:nth-of-type(2) {
|
|
|
|
color: #092C4D;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:nth-of-type(2) {
|
|
|
|
>view:nth-of-type(2) {
|
|
|
|
color: #3AD8BC;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:nth-of-type(3) {
|
|
|
|
>view:nth-of-type(2) {
|
|
|
|
color: #FA8C16;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
>view:nth-of-type(2) {
|
|
|
|
font-size: 36upx;
|
|
|
|
margin-top: 10upx;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
>.type3 {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
margin-bottom: 20upx;
|
|
|
|
font-size: 26upx;
|
|
|
|
color: #161616;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
>.bts {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
align-items: center;
|
|
|
|
padding: 0 20upx;
|
|
|
|
margin-top: 20upx;
|
|
|
|
|
|
|
|
>view {
|
|
|
|
border-radius: 8upx;
|
|
|
|
background: #FFFFFF;
|
|
|
|
opacity: 1;
|
|
|
|
border: 2upx solid #0086F1;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
font-size: 28upx;
|
|
|
|
font-weight: 400;
|
|
|
|
padding: 10upx 30upx;
|
|
|
|
color: #0086F1;
|
|
|
|
margin-bottom: 20upx;
|
|
|
|
margin-right: 20upx;
|
|
|
|
|
|
|
|
&.btn {
|
|
|
|
border-color: var(--subjectColor);
|
|
|
|
color: var(--subjectColor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.tip {
|
|
|
|
$size: 100upx;
|
|
|
|
$border: 4upx solid var(--errColor);
|
|
|
|
$border: 4upx solid var(--errColor);
|
|
|
|
$boxShadow: 0 0 10upx 5upx var(--errColor);
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
top: -36upx;
|
|
|
|
right: -36upx;
|
|
|
|
padding: 15upx;
|
|
|
|
font-size: 0.9rem;
|
|
|
|
border: $border;
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
|
|
view {
|
|
|
|
width: $size;
|
|
|
|
height: $size;
|
|
|
|
border-radius: 50%;
|
|
|
|
border: $border;
|
|
|
|
text-align: center;
|
|
|
|
line-height: $size;
|
|
|
|
color: var(--errColor);
|
|
|
|
font-weight: bold;
|
|
|
|
transform: rotate(-45deg);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
border-color: var(--primaryColor);
|
|
|
|
color: var(--primaryColor);
|
|
|
|
|
|
|
|
view {
|
|
|
|
border-color: var(--primaryColor);
|
|
|
|
color: var(--primaryColor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.tabtip {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
>view {
|
|
|
|
width: 50%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
background-color: #ffffff;
|
|
|
|
font-size: 32upx;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #90A0AF;
|
|
|
|
|
|
|
|
>view {
|
|
|
|
height: 80upx;
|
|
|
|
border-bottom: 8upx solid #ffffff;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.xz {
|
|
|
|
color: var(--subjectColor);
|
|
|
|
border-bottom: 8upx solid var(--subjectColor);
|
|
|
|
// border-radius: 5upx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.font-color {
|
|
|
|
// color: #90A0AF;
|
|
|
|
font-size: 28upx;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 上传
|
|
|
|
:deep(.u-upload__button) {
|
|
|
|
width: 4.5rem !important;
|
|
|
|
height: 4.5rem !important;
|
|
|
|
|
|
|
|
.u-icon__icon {
|
|
|
|
font-size: 1.5rem !important;
|
|
|
|
line-height: 1.5rem !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.u-upload__wrap__preview__image) {
|
|
|
|
width: 4.5rem !important;
|
|
|
|
height: 4.5rem !important;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.u-upload__deletable) {
|
|
|
|
width: 36upx;
|
|
|
|
height: 36upx;
|
|
|
|
|
|
|
|
.u-icon__icon {
|
|
|
|
font-size: 28upx !important;
|
|
|
|
line-height: 28upx !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.popUpMask) {
|
|
|
|
z-index: 99;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 发车前上传
|
|
|
|
.upload_img_item {
|
|
|
|
.upload_img_item_title {
|
|
|
|
margin: 20upx 0;
|
|
|
|
font-weight: bold;
|
|
|
|
color: var(--subjectColor);
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
content: '';
|
|
|
|
width: 4upx;
|
|
|
|
height: 1rem;
|
|
|
|
background-color: var(--subjectColor);
|
|
|
|
margin-right: 20upx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 底部按钮
|
|
|
|
.footer_button {
|
|
|
|
height: 60px;
|
|
|
|
|
|
|
|
.button {
|
|
|
|
position: fixed;
|
|
|
|
height: 80upx;
|
|
|
|
line-height: 80upx;
|
|
|
|
padding: 0 60upx;
|
|
|
|
border-radius: 10upx;
|
|
|
|
color: #fff;
|
|
|
|
background: var(--subjectColor);
|
|
|
|
bottom: 20px;
|
|
|
|
left: 50%;
|
|
|
|
transform: translateX(-50%);
|
|
|
|
transition: all 0.3s;
|
|
|
|
zoom: 1;
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|