Commit 27517dc0 authored by 贺世双's avatar 贺世双

调整签收删除

parent 70713ab9
......@@ -170,6 +170,18 @@ export function getOrderPodDetailSign(data) {
return Request( `/api/entry/{mini}/m-action/getOrderPodDetailSign`,data );
}
//签收操作按钮tm_ie_shipmentstatus
export function getAppIeShipmentStatus(data) {
return Request( `/api/entry/{mini}/m-action/getAppIeShipmentStatus`,data );
}
//签收删除明细tm_ie_shipmentstatus
export function getOrderPodDelete(data) {
return Request( `/api/entry/{mini}/m-action/getOrderPodDelete`,data );
}
// 查询货量明细
// OM模式
export function OMOrderDetail(data) {
......
<template>
<view class="orderPodItem box_shadow_card" >
<view class="orderPodItem box_shadow_card" @click="navToOrderPodDetail()">
<view class="shipment-header flex_sb" style="padding: 28rpx 24rpx 0;">
<view class="consumer_code flex_center">
<text selectable> 回单号:{{propData['pod_no'] || ''}}</text>
......@@ -35,7 +35,6 @@
<view class="flex_cen flex_center orderItemButtonGroup" >
<button class="flex_cen flex_center" @click="onDetailPodSign()">明细上传</button>
<button class="flex_cen flex_center" @click="onAllPodSign()">整单上传</button>
<!-- <button class="flex_cen flex_center" style="margin-top: 24rpx;" @click="onChangeShippingDate()">修改船期</button> -->
</view>
</view>
......@@ -53,6 +52,13 @@
},
},
methods: {
//路由跳转==回单详情界面
navToOrderPodDetail() {
getApp().globalData.orderPodSignEdit = this.propData
wx.navigateTo({
url: `/subpkg/orderPodSignEdit/orderPodSignEdit`,
})
},
//跳转明细签收界面
onDetailPodSign() {
getApp().globalData.orderDetailPodSign = this.propData
......
import { userLogin,authLogin, updateLocation } from "../api/apiList";
import { userLogin,authLogin, updateLocation,userMobileOperation} from "../api/apiList";
import { APP_ID, ENV_MODEL, TokenPrefix } from "../publicConfig/config";
module.exports = {
......@@ -7,7 +7,7 @@ module.exports = {
getWxToken() {
uni.login({
success: (res) => {
// this.login(res.code);
this.login(res.code);
},
});
},
......@@ -65,6 +65,7 @@ module.exports = {
// #endif
//登录Action: loginByUserInfo已与手机号验证码登录实现互通, 故自动认证时默认为loginByUserInfo
let reqData = { entryName: projectMini }
reqData.code = code;
authLogin("loginByUserInfo", code, reqData).then(res => {
let XSRFToken = "";
//#ifdef MP
......@@ -86,15 +87,46 @@ module.exports = {
// #ifdef MP
uni.setStorageSync("cookies", res.cookies);
// #endif
if (route && route !== "pages/login/login" && route !== "/") {
uni.reLaunch({
url: pagePath,
}); //可跳转至任意页面
} else {
uni.switchTab({
url: "/pages/order/order",
});
}
//获取用户信息
userMobileOperation('getUserInfo').then(res => {
var user = res.data.data
if(user.user_gid=="DEFAULT.CARRIER_ADMIN"){
getApp().globalData.tabList = [{
"pagePath": "pages/dirverMenu/dirverMenu",
"text": "司机",
"iconPath": "../../static/img/tabbar/receivebill.png",
"selectedIconPath": "../../static/img/tabbar/receivebill-active.png"
},
{
"pagePath": "pages/user/user",
"text": "我的",
"iconPath": "../../static/img/tabbar/user.png",
"selectedIconPath": "../../static/img/tabbar/user-active.png"
}
]
uni.switchTab({
url: "/pages/dirverMenu/dirverMenu",
})
}else {
getApp().globalData.tabList = [{
"pagePath": "pages/carrierMenu/carrierMenu",
"text": "承运商",
"iconPath": "../../static/img/tabbar/shipment.png",
"selectedIconPath": "../../static/img/tabbar/shipment-active.png"
},
{
"pagePath": "pages/user/user",
"text": "我的",
"iconPath": "../../static/img/tabbar/user.png",
"selectedIconPath": "../../static/img/tabbar/user-active.png"
}
]
uni.switchTab({
url: "/pages/carrierMenu/carrierMenu",
})
}
})
// #ifdef MP
// _this.onUpdateLocation()
// #endif
......
......@@ -158,6 +158,13 @@
"navigationBarTitleText": "明细签收",
"enablePullDownRefresh": false
}
},
{
"path": "orderPodSignEdit/orderPodSignEdit",
"style": {
"navigationBarTitleText": "签收信息",
"enablePullDownRefresh": false
}
}
]
}],
......
......@@ -604,7 +604,7 @@
/deep/.basicInfo,
/deep/.driverLicense,
/deep/.driverJobCertificate {
padding: 0 40rpx;
//padding: 0 40rpx;
background-color: #ffffff;
.input-tip {
......
<template>
<view class="orderPodSignEdit-list content_box">
<view class="orderPodSignEdit-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 class="module-title flex">
<text class="font_bolder">POD信息</text>
<view style="flex: 1;"></view>
<!-- <div style="display: flex; justify-content: flex-end;">
<u-button @click="onRateItemDatail()" style="width: 100px;" type="error" size="small">增加明细</u-button>
</div> -->
</view>
<view class="driverJobCertificate">
<zb-table :show-header="true" :columns="column" :stripe="true" :fit="false" @rowClick="rowClick"
@toggleRowSelection="toggleRowSelection" @toggleAllSelection="toggleAllSelection" :border="true"
@edit="buttonEdit" @dele="dele" :data="podData" :key="index"></zb-table>
</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" label="签收时间" labelWidth="35%" :required="true" borderBottom>
<view ><!--@click="onVisibleDate('time')"-->
<u-input :disabledColor="'#cecece'" disabled border="none" 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="plan_qty" label="应签收数量" labelWidth="35%" borderBottom>
<u-input :disabledColor="'#cecece'" disabled border="none" v-model="formData.plan_qty" />
</u-form-item>
<u-form-item prop="sign_qty" label="签收数量" :required="true" labelWidth="35%" borderBottom>
<u-input :disabledColor="'#cecece'" border="none" v-model="formData.sign_qty" />
</u-form-item>
<u-form-item prop="remark" label="备注" labelWidth="35%" borderBottom>
<u-input :disabledColor="'#cecece'" disabled 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 {getAppIeShipmentStatus, getOrderPodDelete,
getOrderPodDetailSign} from '../../api/apiList.js'
import { formatGMT } from '../../utils/util'
export default {
name: 'orderPodSignEdit',
options: { styleIsolation: 'shared' },
data() {
return {
pageNum: 1, //页码
pageSize: 10, //每页条数
podList: '', //订单列表,当默认为{}时,小程序会自动转结构
rows: [], //当前展开面板
podData:[],
formData: {
time: "", //签收时间
sign_status: "", //签收状态
remark: "", //备注
sign_qty: "", //签收数量
plan_qty: "", //应签收数量
remark: "", //备注
},
rules: {
'sign_status': { required: true },//签收状态
'time': { required: true }, //签收时间
},
currentName: 1,
showPopup: false, //时间选择
visibleKey: '', //当前显示字段的key
optionEnums: [], //候选项枚举
popTitle: '', //弹窗标题
visible: false, //类型选择
viewEnums:[],//状态枚举视图
searchValue: "", //搜索值--船公司
selectEnum:[],//接受返回值
column: [{
name: 'operation',
type: 'operation',
align: 'center',
label: '操作',
renders: [{
name: '编辑',
func: 'edit' // func 代表子元素点击的事件 父元素接收的事件 父元素 @edit
},
{
name: '删除',
type: 'warn',
func: "dele"
},
]
},
{
name: 'time',
label: '签收日期',
fixed: 'true',
width:'100',
},
{
name: 'sign_qty',
label: '签收数量',
width:'80',
}, {
name: 'sign_status',
label: '签收状态'
},{
name: 'remark',
label: '备注'
},
{
name: 'insert_user_label',
label: '上传人',
width:'150',
},{
name: 'image_address',
label: '图片',
width:'150',
},
],
signStatus: {'sign_status': ""},
}
},
onLoad(options) {
const data = getApp().globalData.orderPodSignEdit
const isEmpty = !Object.keys(data).length
this.podList=data;
//获取明细
this.onAppIeShipmentStatus(data.id);
},
methods: {
dele(e) {
const index = e.key; // 找到元素 e 的索引
if (index !== -1) {
console.log(this.podData[index])
//同时执行删除方法
const reqData = {
"args": {
"row": this.podData[index]
}
}
//明细签收
getOrderPodDelete(reqData).then(res => {
if (res.data.data.messageType === 'success') {
uni.showToast({
title: '操作成功!',
duration: 1000
})
}
})
}
this.podData.splice(index, 1); // 移除该元素
},
buttonEdit(e) {
var datas =this.podData
console.log(datas)
for(var i=0; i<datas.length; i++){
console.log(datas[i].sign_status)
this.formData.time =datas[i].sign_time; //签收时间
this.signStatus.sign_status = datas[i].sign_status
this.viewEnums[this.signStatus] =datas[i].sign_status;
console.log(this.viewEnums)
this.formData.remark=datas[i].remark; //备注
this.formData.sign_qty=datas[i].sign_qty; //签收数量
this.formData.plan_qty=null;//应签收数量
}
},
onSignQty(qty){
if(qty==0){
return true;
}
},
//判断异常签收必填
diableRemark(){
if(this.formData.sign_status=="异常签收"){
return true;
}
},
//获取货物明细
onAppIeShipmentStatus(podId) {
const reqData = {
"args": {
"pageNum": 1,
"pageSize": 100,
"podId": podId
}
}
getAppIeShipmentStatus(reqData).then(res => {
const datas = res.data.data.datas
const newData = []
datas.map(item => {
item.time=item.sign_time;//签收时间
item.time = formatGMT(item.sign_time, 'D') ? formatGMT(item.sign_time, 'D') : ""
newData.push({ ...item })
})
this.podData= [...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.orderPodSignEdit;//回单表数据
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;
}
}
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">
.orderPodSignEdit-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;
}
}
.orderPodSignEdit-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;
}
}
.module-title {
margin-top: 20rpx;
.vertical-separate {
height: 40rpx;
border-left: 7rpx solid #797979;
margin-right: 20rpx;
}
}
/deep/.basicInfo,
/deep/.driverLicense,
/deep/.driverJobCertificate {
//padding: 0 40rpx;
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: 40rpx 0;
}
.u-icon {
margin-left: 20rpx;
}
}
}
</style>
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