Commit 4848750c authored by 贺世双's avatar 贺世双

调整app

parent 789b4d77
...@@ -81,6 +81,16 @@ ...@@ -81,6 +81,16 @@
let ua = window.navigator.userAgent.toLowerCase() //判断浏览器类型, 包含浏览器类型、版本、操作系统类型、浏览器引擎类型等信息 let ua = window.navigator.userAgent.toLowerCase() //判断浏览器类型, 包含浏览器类型、版本、操作系统类型、浏览器引擎类型等信息
return ua.match(/MicroMessenger/i) == 'micromessenger' return ua.match(/MicroMessenger/i) == 'micromessenger'
}, },
//获取底部Tab菜单索引 name: 用于识别页面索引的唯一标识,如页面路径为"pages/index/index", 则name取index
getTabIndex(name) {
let tabIndex = 0
this.globalData.tabList.map( (tab, idx) => {
if(tab.pagePath.includes(name)){
tabIndex = idx
}
})
return tabIndex
}
} }
} }
</script> </script>
......
...@@ -143,6 +143,21 @@ export function saveAppAbnormalEvent(data) { ...@@ -143,6 +143,21 @@ export function saveAppAbnormalEvent(data) {
return Request( `/api/entry/{mini}/m-action/saveAppAbnormalEvent`,data ); return Request( `/api/entry/{mini}/m-action/saveAppAbnormalEvent`,data );
} }
//明细签收:查询支架货物明细
export function getTbuOrderPodSingDetailList(data) {
return Request( `/api/entry/{mini}/m-action/getTbuOrderPodSingDetailList`,data );
}
//整单签收操作按钮
export function getOrderPodAllSign(data) {
return Request( `/api/entry/{mini}/m-action/getOrderPodAllSign`,data );
}
//支架明细签收操作按钮
export function getOrderPodDetailSign(data) {
return Request( `/api/entry/{mini}/m-action/getOrderPodDetailSign`,data );
}
// 查询货量明细 // 查询货量明细
// OM模式 // OM模式
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<bs-customCell label="车牌号 :" :value="propData.truck_no" labelCol="2" wrapCol="6" /> <bs-customCell label="车牌号 :" :value="propData.truck_no" labelCol="2" wrapCol="6" />
<bs-customCell label="回单数量 :" :value="propData.pod_count" labelCol="2.5" wrapCol="6" /> <bs-customCell label="回单数量 :" :value="propData.pod_count" labelCol="2.5" wrapCol="6" />
</view> </view>
<view class="flex_cen flex_center orderItemButtonGroup" v-if="propData.sign_status != '正常签收' && propData.sign_status != '异常签收'"> <view class="flex_cen flex_center orderItemButtonGroup" v-if="propData.confirm_status != 'CONFIRMED'">
<button class="flex_cen flex_center" @click="onDetailPodSign()">明细上传</button> <button class="flex_cen flex_center" @click="onDetailPodSign()">明细上传</button>
<button class="flex_cen flex_center" @click="onAllPodSign()">整单上传</button> <button class="flex_cen flex_center" @click="onAllPodSign()">整单上传</button>
...@@ -54,9 +54,9 @@ ...@@ -54,9 +54,9 @@
methods: { methods: {
//跳转明细签收界面 //跳转明细签收界面
onDetailPodSign() { onDetailPodSign() {
getApp().globalData.changeShippingDate = this.propData getApp().globalData.orderDetailPodSign = this.propData
uni.navigateTo({ uni.navigateTo({
url: `/subpkg/changeShippingDate/changeShippingDate`, url: `/subpkg/orderAllPodSign/orderDetailPodSign`,
}) })
}, },
//跳转整单签收界面 //跳转整单签收界面
......
...@@ -10,13 +10,7 @@ ...@@ -10,13 +10,7 @@
"path": "pages/login/login", "path": "pages/login/login",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false, "navigationBarTitleText": "TMS运输系统",
"disableScroll": true
}
}, {
"path": "pages/user/user",
"style": {
"navigationBarTitleText": "个人中心",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
...@@ -34,6 +28,14 @@ ...@@ -34,6 +28,14 @@
"navigationBarTitleText": "承运商", "navigationBarTitleText": "承运商",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path": "pages/user/user",
"style": {
"navigationBarTitleText": "个人中心",
"navigationBarBackgroundColor": "#005BB5",
"enablePullDownRefresh": false
}
}], }],
"subPackages": [{ "subPackages": [{
"root": "subpkg", "root": "subpkg",
...@@ -149,6 +151,13 @@ ...@@ -149,6 +151,13 @@
"navigationBarTitleText": "委托单", "navigationBarTitleText": "委托单",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path": "orderAllPodSign/orderDetailPodSign",
"style": {
"navigationBarTitleText": "明细签收",
"enablePullDownRefresh": false
}
} }
] ]
}], }],
...@@ -170,23 +179,6 @@ ...@@ -170,23 +179,6 @@
"selectedColor": "#2E75E6", "selectedColor": "#2E75E6",
"backgroundColor": "#fff", "backgroundColor": "#fff",
"list": [ "list": [
/*{
"pagePath": "pages/order/order",
"text": "订单",
"iconPath": "static/img/tabbar/order.png",
"selectedIconPath": "static/img/tabbar/order-active.png"
},{
"pagePath": "pages/order/shipment",
"text": "运单",
"iconPath": "static/img/tabbar/shipment.png",
"selectedIconPath": "static/img/tabbar/shipment-active.png"
},
{
"pagePath": "pages/order/order_pod",
"text": "回单",
"iconPath": "static/img/tabbar/receivebill.png",
"selectedIconPath": "static/img/tabbar/receivebill-active.png"
},*/
{ {
"pagePath": "pages/dirverMenu/dirverMenu" "pagePath": "pages/dirverMenu/dirverMenu"
...@@ -195,12 +187,10 @@ ...@@ -195,12 +187,10 @@
}, },
{ {
"pagePath": "pages/user/user", "pagePath": "pages/user/user"
"text": "我的",
"iconPath": "static/img/tabbar/user.png",
"selectedIconPath": "static/img/tabbar/user-active.png"
} }
] ]
} }
} }
<template> <template>
<view class="park_content"> <view class="park_content">
<view class="park_header"> <view class="park_header">
<image class="header-bg" src="../../static/img/bg/souye.png"> <!-- <image class="header-bg" src="../../static/img/bg/souye.png">
</image> </image> -->
</view> <image class="header-bg" src="../../static/img/bg/trina_dl.png"></image>
<view class="shipment_code" style=" display: flex; align-items: center;padding-top:10px;">
<span class="toutitle">运输执行</span>
</view> </view>
<view class="section_2 flex-col">
<text class="text_2">运输执行</text>
<view class="park_body flex_sb flex_wrap"> <view class="park_body flex_sb flex_wrap">
<view class="park_card" v-for="(item,index) in cardList" :key="index" @click="openCard(item.path)"> <view class="park_card" v-for="(item,index) in cardList" :key="index" @click="openCard(item.path)">
<image class="image_2" referrerpolicy="no-referrer" :src="item.src" /> <image class="image_2" referrerpolicy="no-referrer" :src="item.src" />
<view class="card_title">{{item.title}}</view> <view class="card_title">{{item.title}}</view>
</view> </view>
</view> </view>
</view>
<customTabBar tabIndex="0" /> <customTabBar tabIndex="0" />
</view> </view>
</template> </template>
...@@ -114,32 +115,40 @@ ...@@ -114,32 +115,40 @@
.park_header { .park_header {
background-color: #E9EEF6; background-color: #E9EEF6;
height: 288rpx; height: 450rpx;
.header-bg { .header-bg {
width: 100%; width: 100%;
height: 100%; height: 100%;
margin-top: -20px;
} }
} }
.section_2 {
background-color: rgba(255, 255, 255, 1);
border-radius: 24px 24px 0px 0px;
position: relative;
margin-top: -29px;
padding: 5px 2px 130px 2px;
}
.text_2 { .text_2 {
overflow-wrap: break-word; overflow-wrap: break-word;
color: rgba(89, 89, 89, 1); color: rgba(89, 89, 89, 1);
font-size: 38rpx; font-size: 18px;
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-weight: 500; font-weight: 550;
text-align: left; text-align: left;
white-space: nowrap; white-space: nowrap;
line-height: 44px; line-height: 44px;
margin-right: 201px; margin-right: 560px;
margin-left: 10px;
} }
.park_body { .park_body {
padding: 0 21rpx; padding: 0 21rpx;
display: flex; display: flex;
margin-top: -12px;
.park_card { .park_card {
margin-top: 25rpx; margin-top: 25rpx;
width: 310rpx; width: 310rpx;
...@@ -149,7 +158,7 @@ ...@@ -149,7 +158,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
border-radius: 8rpx; border-radius: 10px;
.image_5 { .image_5 {
width: 199rpx; width: 199rpx;
......
<template> <template>
<view class="park_content"> <view class="park_content">
<view class="park_header"> <view class="park_header">
<image class="header-bg" src="../../static/img/bg/souye.png"> <!-- <image class="header-bg" src="../../static/img/bg/loginBg.png">
</image> </image> -->
</view> <image class="header-bg" src="../../static/img/bg/trina_dl.png"></image>
<view class="shipment_code" style=" display: flex; align-items: center;padding-top:10px;">
<span class="toutitle">运输执行</span>
</view> </view>
<view class="section_2 flex-col">
<text class="text_2">运输执行</text>
<view class="park_body flex_sb flex_wrap"> <view class="park_body flex_sb flex_wrap">
<view class="park_card" v-for="(item,index) in cardList" :key="index" @click="openCard(item.path)"> <view class="park_card" v-for="(item,index) in cardList" :key="index" @click="openCard(item.path)">
<image class="image_2" referrerpolicy="no-referrer" :src="item.src" /> <image class="image_2" referrerpolicy="no-referrer" :src="item.src" />
<view class="card_title">{{item.title}}</view> <view class="card_title">{{item.title}}</view>
</view> </view>
</view> </view>
</view>
<customTabBar tabIndex="0" /> <customTabBar tabIndex="0" />
</view> </view>
</template> </template>
...@@ -111,32 +112,39 @@ ...@@ -111,32 +112,39 @@
.park_header { .park_header {
background-color: #E9EEF6; background-color: #E9EEF6;
height: 288rpx; height: 450rpx;
.header-bg { .header-bg {
width: 100%; width: 100%;
height: 100%; height: 100%;
margin-top: -20px;
} }
} }
.section_2 {
background-color: rgba(255, 255, 255, 1);
border-radius: 24px 24px 0px 0px;
position: relative;
margin-top: -29px;
padding: 5px 2px 130px 2px;
}
.text_2 { .text_2 {
overflow-wrap: break-word; overflow-wrap: break-word;
color: rgba(89, 89, 89, 1); color: rgba(89, 89, 89, 1);
font-size: 38rpx; font-size: 18px;
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-weight: 500; font-weight: 550;
text-align: left; text-align: left;
white-space: nowrap; white-space: nowrap;
line-height: 44px; line-height: 44px;
margin-right: 201px; margin-right: 560px;
margin-left: 10px;
} }
.park_body { .park_body {
padding: 0 21rpx; padding: 0 21rpx;
display: flex; display: flex;
margin-top: -12px;
.park_card { .park_card {
margin-top: 25rpx; margin-top: 25rpx;
width: 310rpx; width: 310rpx;
...@@ -146,7 +154,7 @@ ...@@ -146,7 +154,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
border-radius: 8rpx; border-radius: 10px;
.image_5 { .image_5 {
width: 199rpx; width: 199rpx;
......
...@@ -208,8 +208,8 @@ ...@@ -208,8 +208,8 @@
getApp().globalData.tabList = [{ getApp().globalData.tabList = [{
"pagePath": "pages/carrierMenu/carrierMenu", "pagePath": "pages/carrierMenu/carrierMenu",
"text": "承运商", "text": "承运商",
"iconPath": "../../static/img/tabbar/receivebill.png", "iconPath": "../../static/img/tabbar/shipment.png",
"selectedIconPath": "../../static/img/tabbar/receivebill-active.png" "selectedIconPath": "../../static/img/tabbar/shipment-active.png"
}, },
{ {
"pagePath": "pages/user/user", "pagePath": "pages/user/user",
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
</u-cell-group> </u-cell-group>
</view> </view>
<button class="exit-login flex_cen" @click="exitLog">退出登录</button> <button class="exit-login flex_cen" @click="exitLog">退出登录</button>
<customTabBar :tabIndex="getTabIndex()" />
</view> </view>
</template> </template>
...@@ -46,10 +47,13 @@ ...@@ -46,10 +47,13 @@
} }
}, },
onLoad: function(options) { onLoad: function(options) {
this.getUserInfo() //this.getUserInfo()
}, },
methods: { methods: {
//获取Tab菜单索引
getTabIndex() {
return getApp().getTabIndex('user')
},
//获取用户信息 //获取用户信息
getUserInfo() { getUserInfo() {
userMobileOperation('getUserInfo').then(res => { userMobileOperation('getUserInfo').then(res => {
...@@ -176,6 +180,7 @@ ...@@ -176,6 +180,7 @@
border-radius: 48rpx; border-radius: 48rpx;
border: 2rpx solid #8C8C8C; border: 2rpx solid #8C8C8C;
line-height: 96rpx; line-height: 96rpx;
margin-bottom:40px
} }
} }
</style> </style>
...@@ -53,25 +53,31 @@ ...@@ -53,25 +53,31 @@
<u--form :model="formData" :rules="rules" ref="myForm" errorType='none'> <u--form :model="formData" :rules="rules" ref="myForm" errorType='none'>
<view class="basic-info"> <view class="basic-info">
<u-form-item prop="sign_time" required label="签收时间" labelWidth="35%" borderBottom> <u-form-item prop="time" label="签收时间" labelWidth="35%" :required="disableSignQ()" borderBottom>
<view @click="onVisibleDate('sign_time')"> <view @click="onVisibleDate('time')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择签收时间" <u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择签收时间"
:value="convertTime(formData.sign_time)" /> :value="convertTime(formData.time)" />
</view> </view>
</u-form-item> </u-form-item>
<u-form-item prop="sign_status" required label="签收状态" labelWidth="35%" borderBottom>
<u-form-item prop="m_vsl_voy" label="应签收数量" labelWidth="25%" borderBottom> <view @click="onVisible('sign_status')">
<u-input :disabledColor="'#ffffff'" border="none" v-model="formData.m_vsl_voy" /> <u-input border="none" readonly placeholder="请选择签收状态" :value="viewEnums[formData.sign_status]" />
</view>
</u-form-item>
<u-form-item prop="plan_qty" label="应签收数量" labelWidth="35%" borderBottom>
<u-input :disabledColor="'#cecece'" disabled border="none" v-model="formData.plan_qty" />
</u-form-item> </u-form-item>
<u-form-item prop="f_vsl_voy" label="签收数量" labelWidth="35%" borderBottom> <u-form-item prop="sign_qty" label="签收数量" :required="disableSignQ()" labelWidth="35%" borderBottom>
<u-input :disabledColor="'#ffffff'" border="none" v-model="formData.f_vsl_voy" /> <u-input :disabledColor="'#cecece'" :disabled="disableSign()" border="none" v-model="formData.sign_qty" />
</u-form-item> </u-form-item>
<u-form-item prop="remark" label="备注" :required="diableRemark()" labelWidth="35%" borderBottom>
<u-input :disabledColor="'#ffffff'" border="none" v-model="formData.remark" />
</u-form-item>
</view> </view>
</u--form> </u--form>
<!-- 上传图片 --> <!-- 上传图片 -->
<view class="uploader-img"> <view class="uploader-img">
<bs-uploader ref="myUploadImg" :required="requiredStatus" <bs-uploader ref="myUploadImg" :required="true"
uploadTitle="上传图片" /> uploadTitle="上传图片" />
</view> </view>
</view> </view>
...@@ -82,7 +88,7 @@ ...@@ -82,7 +88,7 @@
</view> </view>
<!-- 类型选择动作面板 --> <!-- 类型选择动作面板 -->
<bs-selectPopup :popTitle="popTitle" :selectEnum="optionEnums" :visible="visible2" @onVisible="onVisible" <bs-selectPopup :popTitle="popTitle" :selectEnum="optionEnums" :visible="visible" @onVisible="onVisible"
@onConfirm="onConfirmPicker" /> @onConfirm="onConfirmPicker" />
<!-- 时间选择 --> <!-- 时间选择 -->
<bs-datetimePicker ref="myTimePicker" :visible="showPopup" @onVisible="onVisibleDate" <bs-datetimePicker ref="myTimePicker" :visible="showPopup" @onVisible="onVisibleDate"
...@@ -91,8 +97,7 @@ ...@@ -91,8 +97,7 @@
</template> </template>
<script> <script>
import {queryShipownerAll, updateTmBlEvent, import { getOrderPodAllSign } from '../../api/apiList.js'
OMOrderDetail, OROrderDetail } from '../../api/apiList.js'
import { formatGMT } from '../../utils/util' import { formatGMT } from '../../utils/util'
export default { export default {
name: 'orderAllPodSign', name: 'orderAllPodSign',
...@@ -104,14 +109,16 @@ ...@@ -104,14 +109,16 @@
podList: '', //订单列表,当默认为{}时,小程序会自动转结构 podList: '', //订单列表,当默认为{}时,小程序会自动转结构
rows: [], //当前展开面板 rows: [], //当前展开面板
formData: { formData: {
sign_time: "", //签收时间 time: "", //签收时间
sign_qty: "", //签收数量 sign_qty: "", //签收数量
plan_qty: "", //应签收数量 plan_qty: "", //应签收数量
sign_status: "", //签收状态
remark: "", //备注
}, },
rules: { rules: {
'sign_time': { required: true },//签收时间 'time': { required: true },//签收时间
'sign_qty': { required: true }, //签收数量 'sign_qty': { required: true }, //签收数量
'sign_status': { required: true }, //签收状态
}, },
showPopup: false, //时间选择 showPopup: false, //时间选择
visibleKey: '', //当前显示字段的key visibleKey: '', //当前显示字段的key
...@@ -121,23 +128,44 @@ ...@@ -121,23 +128,44 @@
viewEnums:[],//船公司枚举视图 viewEnums:[],//船公司枚举视图
searchValue: "", //搜索值--船公司 searchValue: "", //搜索值--船公司
selectEnum:[],//接受返回值 selectEnum:[],//接受返回值
execute_bu:"",
} }
}, },
onLoad(options) { onLoad(options) {
const data = getApp().globalData.orderAllPodSign const data = getApp().globalData.orderAllPodSign
if(data.execute_bu=='TBU'){
this.formData.plan_qty = data.pod_count;
this.formData.sign_qty = data.pod_count;//签收数量
}
this.execute_bu= data.execute_bu
const isEmpty = !Object.keys(data).length const isEmpty = !Object.keys(data).length
// this.podList.sp__local_etd = data.sp__local_etd==""?"":formatGMT(data.sp__local_etd, 'D') ;
// this.podList.sp__local_atd = data.sp__local_atd==""?"":formatGMT(data.sp__local_atd, 'D');
// this.podList.sp__local_eta = data.sp__local_eta==""?"":formatGMT(data.sp__local_eta, 'D') ;
// this.podList.sp__local_ata = data.sp__local_ata==""?"":formatGMT(data.sp__local_ata, 'D');
this.podList=data; this.podList=data;
this.isEmpty = isEmpty
if (!isEmpty) {
this.activeNames = [data.id]
}
}, },
methods: { methods: {
//判断组件还是直接是否必填
disableSign(){
if(this.execute_bu=='TBU'){
return true;
}else{
return false;
}
},
//判断组件还是直接是否必填
disableSignQ(){
if(this.execute_bu!='TBU'){
return true;
}else{
return false;
}
},
//判断异常签收必填
diableRemark(){
if(this.formData.sign_status=="异常签收"){
return true;
}
},
showProcess() { showProcess() {
this.visible = true this.visible = true
}, },
...@@ -161,60 +189,79 @@ ...@@ -161,60 +189,79 @@
this.selectEnum = [] this.selectEnum = []
this.searchValue ='' this.searchValue =''
}, },
//类型选择
async onVisible(type) {
if (this.visible2) {
this.visible2 = false
} else {
let optionEnums = []
let setKey = 'viewEnums' //要设置的字段Key
if (type == 'multimodal_transport') {
setKey = 'genderViewEnums'
optionEnums = [{ label: '陆改铁含短驳', value: 'land_to_railway' },
{ label: '陆改水含短驳', value: 'land_to_water' },
{ label: '全程拖车', value: 'road' },
{ label: '第六港', value: 'sixth_port' },
{ label: '内装', value: 'interior' }]
} if (type =="shipowner") {
const res = await queryShipownerAll()
optionEnums = res.data.data.datas
}
this.setViewEnums(optionEnums, setKey)
this.optionEnums = optionEnums
this.visibleKey = type
this.visible2 = true
}
},
// 提交表单数据 // 提交表单数据
onSubmitForm() { onSubmitForm() {
const rows = getApp().globalData.orderAllPodSign; const row = getApp().globalData.orderAllPodSign;//回单表数据
this.formData.rows= rows; if (this.formData.sign_status==null || this.formData.sign_status=="") {
this.formData.bl_event_code="booking_confirmed"; uni.showToast({
title: "签收状态必填",
var baseData = { icon: 'none',
"aux": { duration: 2000
"rows":rows, })
"aux":this.formData, return;
}, }else{
} if(this.formData.sign_status=="异常签收"){
//订舱委托确认操作 if (this.formData.remark==null || this.formData.remark=="") {
updateTmBlEvent(baseData).then(res => { uni.showToast({
title: "异常签收时备注必填",
icon: 'none',
duration: 2000
})
return;
}
}
}
//验证金额
var signQty =uni.$u.test.number(this.formData.sign_qty)
if (!signQty && this.execute_bu!='TBU') {
uni.showToast({
title: "请填写正确的金额",
icon: 'none',
duration: 2000
})
return;
}
const imgInstance = this.$refs.myUploadImg //获取图片上传实例
imgInstance.uploadImage(images => {
this.formData.files=images;//图片或者文件
this.formData.time= this.convertTimeHh24(this.formData.time)
var baseData = {
"aux": {
"row":row,
"aux":this.formData,//签收数据
},
}
//整单签收
getOrderPodAllSign(baseData).then(res => {
if (res.data.data.messageType === 'success') { if (res.data.data.messageType === 'success') {
uni.showToast({ uni.showToast({
title: '确认成功!', title: '操作成功!',
duration: 1000 duration: 1000
}) })
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 1500) }, 1500)
} }
}) })
})
},
//上报类型选择
async onVisible(type) {
if (this.visible) { //关闭
this.visible = false
} else {
let optionEnums = []
let setKey = 'viewEnums' //要设置的字段Key
if(type=='sign_status'){
setKey = 'viewEnums' //要设置的字段Key
optionEnums = [{ label: '正常签收', value: '正常签收' },
{ label: '异常签收', value: '异常签收' }]
}
this.setViewEnums(optionEnums, setKey)
this.optionEnums = optionEnums
this.visibleKey = type
this.visible = true
}
}, },
//设置显示枚举 //设置显示枚举
setViewEnums(optionEnums, key) { setViewEnums(optionEnums, key) {
...@@ -249,6 +296,16 @@ ...@@ -249,6 +296,16 @@
this.formData[key] = value this.formData[key] = value
} }
}, },
//页面展示时间戳转换为年月日时分秒
convertTimeHh24(timestamp) {
if (!timestamp) return
const nowDate = new Date(timestamp)
var year = nowDate.getFullYear();
var month = nowDate.getMonth() < 10 ? '0' + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
var date = nowDate.getDate();
return `${year}-${ month}-${date} 00:00:00`
},
} }
} }
</script> </script>
......
<template>
<view class="orderDetailPodSign-list content_box">
<view class="orderDetailPodSign-item">
<!-- 基本信息 -->
<view class="module-title flex">
<text class="font_bolder">基本信息</text>
</view>
<bs-customCell label="基础订单号 :" :value="podList.pod_no" labelCol="3" wrapCol="6" />
<bs-customCell label="回单类型 :" :value="podList.pod_type_label" labelCol="3" wrapCol="6" />
<bs-customCell label="回单数量 :" :value="podList.pod_count" labelCol="2.5" wrapCol="6" />
<view class=" flex_sb">
<view style="width: 50%;float: left;">
<bs-customCell label="始发地 :" :value="podList.source_location_name" labelCol="4.5" wrapCol="6" />
</view>
<view style="width: 50%;float: left;">
<bs-customCell label="目的地 :" :value="podList.dest_location_name" labelCol="4.5" wrapCol="6" />
</view>
</view>
<bs-customCell label="承运商 :" :value="podList.servprov_name" labelCol="2" wrapCol="8" />
<!-- 拖车信息 -->
<view class="module-title flex">
<text class="font_bolder">拖车信息</text>
</view>
<bs-customCell label="运单号 :" :value="podList.shipment_no" labelCol="2" wrapCol="6" />
<bs-customCell label="订舱/托书号 :" :value="podList.sp__booking_no" labelCol="3" wrapCol="6" />
<bs-customCell label="车牌号 :" :value="podList.truck_no" labelCol="2" wrapCol="6" />
<view class=" flex_sb">
<view style="width: 50%;float: left;">
<bs-customCell label="计划提货 :" :value="podList.sp__local_etd" labelCol="4.5" wrapCol="6" />
</view>
<view style="width: 50%;float: left;">
<bs-customCell label="实际提货 :" :value="podList.sp__local_atd" labelCol="4.5" wrapCol="6" />
</view>
</view>
<view class=" flex_sb">
<view style="width: 50%;float: left;">
<bs-customCell label="计划进港 :" :value="podList.sp__local_eta" labelCol="4.5" wrapCol="6" />
</view>
<view style="width: 50%;float: left;">
<bs-customCell label="实际进港 :" :value="podList.sp__local_ata" labelCol="4.5" wrapCol="6" />
</view>
</view>
<view v-for="(item,index) in orderList" :key="item.id">
<uni-collapse ref="myCollapseNo">
<view class="outer-frame" :data-id="item.id">
<uni-collapse-item :show-arrow="false" title-border="none" open :name="item.id">
<!-- 自定义标题栏 -->
<template v-slot:title>
<view class="foldPanel-title flex_center">
<text style="flex-grow: 1">货物明细</text>
<!-- 自定义标题栏右侧图标 -->
<view
:class="['foldPanel-right-icon', 't-icon', currentName ===item.id && isFold ? 't-icon-fold-blue' :'t-icon-unfold-blue']" />
</view>
</template>
<!-- 货物详情 -->
<view class="cargo-detail-table">
<view class="detail-row-title">
<u-row>
<u-col textAlign="center" span="3">料号</u-col>
<u-col textAlign="center" span="4">货物名称</u-col>
<u-col textAlign="center" span="2.5">出库数量</u-col>
<u-col textAlign="center" span="2.5">签收数量</u-col>
</u-row>
</view>
<u-empty mode="data" textSize='32' iconSize="160" text="暂无货物明细"
v-if="!item.cargoDetails.length" />
<template>
<view class="detail-col-item" v-for="(itm,indexs) in item.cargoDetails" :key="itm.id">
<u-row>
<u-col span="3" class="cargo-title" textAlign="left">
<view class="cargo-title">
<u-input v-model="itm.line__product_code" disabled inputAlign="left" border="none"
placeholder="料号" />
</view>
</u-col>
<u-col span="4" class="cargo-title" textAlign="left">
<view class="cargo-title">
<u-input v-model="itm.line__product_name" disabled inputAlign="left" border="none"
placeholder="货物名称" />
</view>
</u-col>
<u-col span="2.5">
<view class="cargo-title">
<u-input v-model="itm.line__qty" disabled inputAlign="center" border="none"
placeholder="出库数" />
</view>
</u-col>
<u-col span="2.5">
<view class="cargo-title">
<u-input v-model="itm.this_qty" inputAlign="center" border="none" :disabled="onSignQty(itm.this_qty)" color="#ec2e0d"
placeholder="签收数" />
</view>
</u-col>
</u-row>
</view>
</template>
</view>
</uni-collapse-item>
</view>
</uni-collapse>
</view>
<!-- 上传回单 -->
<view class="module-title flex">
<text class="font_bolder">上传回单</text>
</view>
<!-- 注册内容 -->
<u--form :model="formData" :rules="rules" ref="myForm" errorType='none'>
<view class="basic-info">
<u-form-item prop="time" required label="签收时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('time')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择签收时间"
:value="convertTime(formData.time)" />
</view>
</u-form-item>
<u-form-item prop="sign_status" required label="签收状态" labelWidth="35%" borderBottom>
<view @click="onVisible('sign_status')">
<u-input border="none" readonly placeholder="请选择签收状态" :value="viewEnums[formData.sign_status]" />
</view>
</u-form-item>
<u-form-item prop="remark" label="备注" :required="diableRemark()" labelWidth="35%" borderBottom>
<u-input :disabledColor="'#ffffff'" border="none" v-model="formData.remark" />
</u-form-item>
</view>
</u--form>
<!-- 上传图片 -->
<view class="uploader-img">
<bs-uploader ref="myUploadImg" :required="true"
uploadTitle="上传图片" />
</view>
</view>
<!-- 底部按钮 -->
<view class="operation-btn flex_sb">
<button class="backBtn common_btn" @click="onNavBack">返回</button>
<button class="submitBtn common_btn" @click="onSubmitForm">确认</button>
</view>
<!-- 类型选择动作面板 -->
<bs-selectPopup :popTitle="popTitle" :selectEnum="optionEnums" :visible="visible" @onVisible="onVisible"
@onConfirm="onConfirmPicker" />
<!-- 时间选择 -->
<bs-datetimePicker ref="myTimePicker" :visible="showPopup" @onVisible="onVisibleDate"
@onSelsectDate="onSelsectDate" />
</view>
</template>
<script>
import {getTbuOrderPodSingDetailList, getOrderPodDetailSign} from '../../api/apiList.js'
import { formatGMT } from '../../utils/util'
export default {
name: 'orderDetailPodSign',
options: { styleIsolation: 'shared' },
data() {
return {
pageNum: 1, //页码
pageSize: 10, //每页条数
podList: '', //订单列表,当默认为{}时,小程序会自动转结构
rows: [], //当前展开面板
formData: {
time: "", //签收时间
sign_status: "", //签收状态
remark: "", //备注
},
rules: {
'sign_status': { required: true },//签收状态
'time': { required: true }, //签收时间
},
currentName: 1,
orderList: [{
id: 1,
name: "货物明细",
cargoDetails: [{
product_code: "",
product_name: "",
qty: "",
this_qty: "",
}],
}],
showPopup: false, //时间选择
visibleKey: '', //当前显示字段的key
optionEnums: [], //候选项枚举
popTitle: '', //弹窗标题
visible: false, //类型选择
viewEnums:[],//船公司枚举视图
searchValue: "", //搜索值--船公司
selectEnum:[],//接受返回值
}
},
onLoad(options) {
const data = getApp().globalData.orderDetailPodSign
const isEmpty = !Object.keys(data).length
this.podList=data;
//获取明细
this.onTbuOrderPodSingDetail(data.id);
},
methods: {
onSignQty(qty){
if(qty==0){
return true;
}
},
//判断异常签收必填
diableRemark(){
if(this.formData.sign_status=="异常签收"){
return true;
}
},
//获取货物明细
onTbuOrderPodSingDetail(podId) {
const reqData = {
"args": {
"pageNum": 1,
"pageSize": 100,
"podId": podId
}
}
getTbuOrderPodSingDetailList(reqData).then(res => {
const datas = res.data.data.datas
const newData = []
datas.map(item => {
item.qty=item.line__qty;//出库数量
item.this_qty=item.line__qty-item.line__sign_qty;//本次签收数量=总数量-已签收数量
item.sign_qty=item.line__sign_qty//已签收数量
item.product_code=item.line__product_code;//料号
item.product_name=item.line__product_name;//货物品名
newData.push({ ...item })
})
this.orderList[0].cargoDetails= [...newData]
})
},
//上报类型选择
async onVisible(type) {
if (this.visible) { //关闭
this.visible = false
} else {
let optionEnums = []
let setKey = 'viewEnums' //要设置的字段Key
if(type=='sign_status'){
setKey = 'viewEnums' //要设置的字段Key
optionEnums = [{ label: '正常签收', value: '正常签收' },
{ label: '异常签收', value: '异常签收' }]
}
this.setViewEnums(optionEnums, setKey)
this.optionEnums = optionEnums
this.visibleKey = type
this.visible = true
}
},
showProcess() {
this.visible = true
},
// 时间选择
onSelsectDate(dateInfo) {
const {
timestamp
} = dateInfo
this.setFormData(timestamp)
this.showPopup = false
},
//关闭时间选择框
onVisibleDate(type) {
if (type) {
this.visibleKey = type
}
this.showPopup = !this.showPopup
},
onSearchclear(){
this.selectEnum = []
this.searchValue =''
},
// 提交表单数据
onSubmitForm() {
const row = getApp().globalData.orderDetailPodSign;//回单表数据
if (this.formData.sign_status==null || this.formData.sign_status=="") {
uni.showToast({
title: "签收状态必填",
icon: 'none',
duration: 2000
})
return;
}else{
if(this.formData.sign_status=="异常签收"){
if (this.formData.remark==null || this.formData.remark=="") {
uni.showToast({
title: "异常签收时备注必填",
icon: 'none',
duration: 2000
})
return;
}
}
}
//验证签收
var cargoDetails = this.orderList[0].cargoDetails;
var totle=0;
if(cargoDetails.length>0){
cargoDetails.map(item => {
item.this_qty = Number(item.this_qty);
var thisQty= uni.$u.test.number(item.this_qty)
if (!thisQty) {
totle+=1;
}
})
if(totle>0){
uni.showToast({
title: "请填写正确的签收数量",
icon: 'none',
duration: 2000
})
return;
}
}
console.log('111===========')
console.log(row)
const imgInstance = this.$refs.myUploadImg //获取图片上传实例
imgInstance.uploadImage(images => {
this.formData.files=images;//图片或者文件
this.formData.time= this.convertTimeHh24(this.formData.time)
var baseData = {
"aux": {
"row": row,
"headData": this.formData,
"detailData": cargoDetails,
},
}
//明细签收
getOrderPodDetailSign(baseData).then(res => {
if (res.data.data.messageType === 'success') {
uni.showToast({
title: '操作成功!',
duration: 1000
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
}
})
})
},
//设置显示枚举
setViewEnums(optionEnums, key) {
let viewEnums = {}
optionEnums.map(item => {
viewEnums[item.value] = item.label
})
this[key] = viewEnums
},
//确认选择
onConfirmPicker(value) {
this.setFormData(value)
this.visible = false
},
//页面展示时间戳转换为日期
convertTime(timestamp) {
if (!timestamp) return
const nowDate = new Date(timestamp)
var year = nowDate.getFullYear();
var month = nowDate.getMonth() + 1;
var date = nowDate.getDate();
return `${year}-${ month}-${date}`
},
//设置formData
setFormData(value) {
const key = this.visibleKey
if (key.includes('.')) { //对象特殊处理
const keys = key.split('.')
this.formData[keys[0]][keys[1]] = value
} else {
this.formData[key] = value
}
},
//页面展示时间戳转换为年月日时分秒
convertTimeHh24(timestamp) {
if (!timestamp) return
const nowDate = new Date(timestamp)
var year = nowDate.getFullYear();
var month = nowDate.getMonth() < 10 ? '0' + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
var date = nowDate.getDate();
return `${year}-${ month}-${date} 00:00:00`
},
}
}
</script>
<style lang="scss">
.orderDetailPodSign-list {
.module-title {
margin-top: 20rpx;
//padding: 15rpx 0rpx 16rpx;
//background-color:#a2a2a2;
.vertical-separate {
height: 40rpx;
border-left: 7rpx solid #797979;
margin-right: 20rpx;
}
}
.select-container {
min-width: 70vw;
height: 50vh;
padding: 30rpx;
font-weight: 400;
.popTitle {
color: #8C8C8C;
font-size: 32rpx;
text-align: center;
margin-bottom: 44rpx;
}
.select-list{
height: 460rpx;
}
}
.orderDetailPodSign-item {
padding: 32rpx;
margin-bottom: 24rpx;
background: #FFFFFF;
.detail-title {
font-size: 28rpx;
padding: 8rpx 0 30rpx;
border-bottom: 1rpx solid #E5E5E5;
.t-icon-order {
width: 50rpx;
height: 50rpx;
margin-right: 20rpx;
}
}
/deep/.custom-cell-row {
margin-top: 10rpx;
.custom-cell-label {
color: #8C8C8C;
}
}
.outer-frame {
margin-top: 32rpx;
border-radius: 16rpx;
border: 2rpx solid #F0F0F0;
overflow: hidden;
.foldPanel-title {
color: #2E75E6;
font-size: 28rpx;
padding-left: 20rpx;
height: 96rpx;
background: rgba(46, 117, 230, .1);
.foldPanel-right-icon {
margin-right: 20rpx;
}
}
/deep/.cargo-detail-table {
background: #FFFFFF;
padding-bottom: 10rpx;
.detail-row-title {
color: #8C8C8C;
background: #FAFAFA;
padding: 20rpx 0;
}
.detail-col-item {
margin: 20rpx;
.cargo-title {
font-size: 28rpx;
padding-left: 20rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
}
.snapshoot image {
margin: 20rpx 15rpx;
width: 140rpx;
height: 140rpx;
}
/deep/.basic-info,
/deep/.driving-license {
padding: 0 10rpx;
background-color: #ffffff;
.input-tip {
font-size: 28rpx;
color: #BFBFBF;
}
.u-form-item__body__left__content__label {
color: #8C8C8C;
font-size: 28rpx;
}
.u-form-item__body {
padding: 25rpx 0;
}
.u-icon {
margin-left: 20rpx;
}
.u-upload__wrap>view {
width: 100%;
}
.previewImages {
width: 100%;
.previewImg {
width: 100% !important;
height: 240rpx !important;
}
}
.uploadeBtn {
width: 100% !important;
height: 240rpx !important;
margin-bottom: 30rpx;
margin-left: 0 !important;
}
.orderTotal {
display: none;
}
}
}
</style>
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<script> <script>
import { getOrderPodList, getOrderPodSingList} from '../../api/apiList.js' import { getOrderPodList, getOrderPodSingList} from '../../api/apiList.js'
import { formatGMT } from '../../utils/util'
export default { export default {
data() { data() {
return { return {
...@@ -74,7 +75,21 @@ ...@@ -74,7 +75,21 @@
getOrderPodList(reqData).then(res=>{ getOrderPodList(reqData).then(res=>{
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
const data = res.data.data.datas const data = res.data.data.datas
if (data.length > 0) { if (data.length > 0) {
data.map(item => { //格式化时间
if(item.sp__local_etd){
item.sp__local_etd = formatGMT(item.sp__local_etd, 'D') ;
}
if(item.sp__local_atd){
item.sp__local_atd = formatGMT(item.sp__local_atd, 'D') ;
}
if(item.sp__local_eta){
item.sp__local_eta = formatGMT(item.sp__local_eta, 'D') ;
}
if(item.sp__local_ata){
item.sp__local_ata = formatGMT(item.sp__local_ata, 'D') ;
}
})
this.orderPod = this.orderPod.concat(data) this.orderPod = this.orderPod.concat(data)
this.pageNum += 1 this.pageNum += 1
this.loadMore = true this.loadMore = true
...@@ -84,7 +99,21 @@ ...@@ -84,7 +99,21 @@
getOrderPodSingList(reqData).then(res=>{ getOrderPodSingList(reqData).then(res=>{
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
const data = res.data.data.datas const data = res.data.data.datas
if (data.length > 0) { if (data.length > 0) {
data.map(item => { //格式化时间
if(item.sp__local_etd){
item.sp__local_etd = formatGMT(item.sp__local_etd, 'D') ;
}
if(item.sp__local_atd){
item.sp__local_atd = formatGMT(item.sp__local_atd, 'D') ;
}
if(item.sp__local_eta){
item.sp__local_eta = formatGMT(item.sp__local_eta, 'D') ;
}
if(item.sp__local_ata){
item.sp__local_ata = formatGMT(item.sp__local_ata, 'D') ;
}
})
this.orderPod = this.orderPod.concat(data) this.orderPod = this.orderPod.concat(data)
this.pageNum += 1 this.pageNum += 1
this.loadMore = true this.loadMore = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment