parent
844494ed8d
commit
7b656331eb
Before Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 36 KiB |
@ -0,0 +1,192 @@ |
||||
// pages/otherLogistics/otherLogistics.js
|
||||
//重写第三方物流
|
||||
var datePicker = require('../../utils/dateSetting') |
||||
var request = require('../../utils/http') |
||||
var dateUtils = require('../../utils/dateUtils') |
||||
Page({ |
||||
|
||||
/** |
||||
* 页面的初始数据 |
||||
*/ |
||||
data: { |
||||
|
||||
selfOrderCode: '', //物流单号
|
||||
list: [{ |
||||
'id': 1, |
||||
'number': '2023050002', |
||||
'time': '2023-5-12 11:32', |
||||
'status': '已签收', |
||||
'name': '张三', |
||||
'num': 'M2023055568' |
||||
}], |
||||
pipenum: '', |
||||
ins: ['顺丰','京东'], |
||||
insIdx: 0, //物流所选下标
|
||||
date: '', |
||||
start: '2023-07-01', // 时间选择器开始时间
|
||||
end: '', // 时间选择器结束时间
|
||||
|
||||
potoSrc: '../../images/addPoto.png', //默认图片
|
||||
poto: [], //车辆&转运箱照片 最大长度 4
|
||||
|
||||
expectedEndTime: '', //预计到达时间
|
||||
multiArray: [], |
||||
multiIndex: [0, 0, 0, 0, 0], |
||||
choose_year: "", |
||||
srcArray: [], //照片临时路径
|
||||
phone: '', //物流电话
|
||||
boxNum: '', //转运箱号
|
||||
cost: '', //物流费用
|
||||
logisticsMen: '', //物流员
|
||||
notes: '', //备注
|
||||
|
||||
sampleCount: '0', //样本数量
|
||||
//样本列表
|
||||
sampleList: [{ |
||||
'id': 1, |
||||
'number': '2023050002', |
||||
'time': '2023-5-12 11:32', |
||||
'status': '已签收', |
||||
'name': '张三', |
||||
'num': 'M2023055568' |
||||
}] |
||||
}, |
||||
|
||||
//扫描物流单号
|
||||
qrLogisticsCode(e){ |
||||
console.log(JSON.stringify(e)); |
||||
wx.scanCode({ |
||||
success: (res) => { |
||||
this.setData({ |
||||
pipenum: res.result |
||||
}) |
||||
} |
||||
}) |
||||
}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面加载 |
||||
*/ |
||||
onLoad(options) { |
||||
|
||||
let now = new Date(); //获取时间
|
||||
let year = now.getFullYear(); //获取当前年
|
||||
let month = now.getMonth() + 1; //获取当前月份
|
||||
this.setData({ |
||||
end: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2), //当前的时间
|
||||
//开始
|
||||
multiArray: [ |
||||
[year + "年", year + 1 + "年", year + 2 + "年"], |
||||
datePicker.determineMonth(), |
||||
datePicker.determineDay(year, month), |
||||
datePicker.determineHour(), |
||||
datePicker.determineMinute() |
||||
], |
||||
//结束
|
||||
multiArray1: [ |
||||
[year + "年", year + 1 + "年", year + 2 + "年"], |
||||
datePicker.determineMonth(), |
||||
datePicker.determineDay(year, month), |
||||
datePicker.determineHour(), |
||||
datePicker.determineMinute() |
||||
], |
||||
}) |
||||
|
||||
//获取物流单号 1.自建物流 2.第三方物流 3.货运物流 [录入第三方物流号]
|
||||
// request.get(`/batch/getBatchsNumber?logisticsWay=1`).then(res => {
|
||||
// if (res.data.code == 200) {
|
||||
// this.data.selfOrderCode = res.data.data
|
||||
// this.setData({
|
||||
// selfOrderCode: res.data.data
|
||||
// })
|
||||
// // this.selSampleList(); //查询物流批次列表
|
||||
// }
|
||||
// })
|
||||
|
||||
|
||||
//获取送检机构列表
|
||||
// request.post(`/institution/selectInstitution`).then(res => {
|
||||
// var array = res.data.data
|
||||
// var tempArr = []
|
||||
// for (let index = 0; index < array.length; index++) {
|
||||
// tempArr.push(array[index].orgName)
|
||||
// }
|
||||
// this.setData({
|
||||
// ins: tempArr
|
||||
// })
|
||||
// })
|
||||
|
||||
//初始化照片按钮
|
||||
var tempSrc = [] |
||||
for (let index = 0; index < 12; index++) { |
||||
tempSrc.push(this.data.potoSrc) |
||||
} |
||||
|
||||
this.setData({ |
||||
poto: tempSrc |
||||
}) |
||||
|
||||
//获取转运箱信息
|
||||
request.post(`/box/selectTranBox`).then(res => { |
||||
var array = res.data.data |
||||
var tempBoxList = [] |
||||
for (let index = 0; index < array.length; index++) { |
||||
tempBoxList.push(array[index].boxNum) |
||||
} |
||||
this.setData({ |
||||
boxList: tempBoxList |
||||
}) |
||||
|
||||
}) |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面初次渲染完成 |
||||
*/ |
||||
onReady() { |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面显示 |
||||
*/ |
||||
onShow() { |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面隐藏 |
||||
*/ |
||||
onHide() { |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 生命周期函数--监听页面卸载 |
||||
*/ |
||||
onUnload() { |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 页面相关事件处理函数--监听用户下拉动作 |
||||
*/ |
||||
onPullDownRefresh() { |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 页面上拉触底事件的处理函数 |
||||
*/ |
||||
onReachBottom() { |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* 用户点击右上角分享 |
||||
*/ |
||||
onShareAppMessage() { |
||||
|
||||
} |
||||
}) |
@ -0,0 +1,3 @@ |
||||
{ |
||||
"usingComponents": {} |
||||
} |
@ -0,0 +1,96 @@ |
||||
<!--pages/otherLogistics/otherLogistics.wxml--> |
||||
<view class="box"> |
||||
|
||||
<view class="back"> |
||||
<view class="top"> |
||||
<input type="text" value="{{pipenum}}" /> |
||||
<view style="background-color: #eee;" bindtap="scacode">扫 码</view> |
||||
</view> |
||||
|
||||
<view class="back" style="padding: 0rpx;"> |
||||
<view class="con"> |
||||
<view style="flex: 1;">总计:{{sampleCount}}/管数</view> |
||||
<button style="background-color: #ddd;" hidden="true">修 改</button> |
||||
<button style="color: #fff;" bindtap="saveInfo">保 存</button> |
||||
</view> |
||||
|
||||
<!-- 样本列表 --> |
||||
<scroll-view scroll-x scroll-y class="tabel" style="height: 400rpx;"> |
||||
<view class="tr tab-top"> |
||||
<view class="td1">序号</view> |
||||
<view class="td">样本条码号</view> |
||||
<view class="td">接收时间</view> |
||||
<view class="td">样本状态</view> |
||||
<view class="td">物流员</view> |
||||
<view class="td">物流单号</view> |
||||
</view> |
||||
<view class="tr" wx:for="{{sampleList}}" wx:key="index" bindtap="goDetail"> |
||||
<view class="td1" bindtap="goDetail">{{item.id}}</view> |
||||
<view class="td">{{item.number}}</view> |
||||
<view class="td">{{item.time}}</view> |
||||
<view class="td">{{item.status}}</view> |
||||
<view class="td">{{item.name}}</view> |
||||
<view class="td">{{item.num}}</view> |
||||
</view> |
||||
</scroll-view> |
||||
</view> |
||||
|
||||
<!--拍照--> |
||||
<view class="back"> |
||||
<view class="bush"> |
||||
<view style="flex: 1;">转运箱拍照</view> |
||||
<!-- <button bindtap="boxPhot">拍 照</button> --> |
||||
</view> |
||||
<view class="bush-img"> |
||||
<image bindtap="photograph" src="{{poto[1]}}" data-id="box_1"></image> |
||||
<image bindtap="photograph" src="{{poto[3]}}" data-id="box_2"></image> |
||||
<image bindtap="photograph" src="{{poto[1]}}" data-id="car_2"></image> |
||||
<image bindtap="photograph" src="{{poto[1]}}" data-id="car_2"></image> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="form"> |
||||
<view class="from-con"> |
||||
<label>物流单号:</label> |
||||
<input type="text" bindtap="qrLogisticsCode" focus="false" placeholder="物流单号" placeholder-class="place" value="{{selfOrderCode}}" /> |
||||
</view> |
||||
|
||||
<picker class="from-con" bindchange="bindPickerChange" value="{{index}}" range="{{ins}}"> |
||||
<label>物流单位:</label> |
||||
<input type="text" disabled="true" placeholder="请选择物流单位" placeholder-class="place" value="{{ins[index]}}" /> |
||||
</picker> |
||||
|
||||
<!-- <picker mode="date" value="date" start="{{start}}" end="{{end}}" bindchange="bindDateChange" class="from-con"> |
||||
<label>日期:</label> |
||||
<input type="text" disabled="true" placeholder="请选择日期" placeholder-class="place" value="{{date}}" /> |
||||
</picker> --> |
||||
|
||||
<view class="from-con"> |
||||
<label>物流电话:</label> |
||||
<input type="text" placeholder="物流电话" placeholder-class="place" bindinput="inputTextInfo" data-id="phone" value="{{phone}}" /> |
||||
</view> |
||||
<view class="from-con"> |
||||
<label>物流费用:</label> |
||||
<input type="text" placeholder="物流费用" placeholder-class="place" bindinput="inputTextInfo" data-id="cost" value="{{cost}}" /> |
||||
</view> |
||||
<view class="from-con"> |
||||
<label>转运箱号:</label> |
||||
<input type="text" placeholder="转运箱号" placeholder-class="place" bindinput="inputTextInfo" data-id="boxNum" value="{{boxNum}}" /> |
||||
</view> |
||||
<picker class="from-con" mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex}}" range="{{multiArray}}"> |
||||
<label>预计到达时间:</label> |
||||
<input value='{{expectedEndTime}}' placeholder='请选择到达时间' placeholder-class="place" disabled="true" /> |
||||
</picker> |
||||
<view class="from-con"> |
||||
<label>物流员:</label> |
||||
<input type="text" bindinput="inputTextInfo" data-id="logisticsMen" placeholder="物流员" placeholder-class="place" value="{{logisticsMen}}" /> |
||||
</view> |
||||
<view class="from-con"> |
||||
<label>备注:</label> |
||||
<input type="text" placeholder="备注" placeholder-class="place" bindinput="inputTextInfo" data-id="notes" value="{{notes}}" /> |
||||
</view> |
||||
|
||||
</view> |
||||
</view> |
||||
|
||||
</view> |
@ -0,0 +1,140 @@ |
||||
/* pages/otherLogistics/otherLogistics.wxss */ |
||||
.top{ |
||||
display: flex; |
||||
justify-content: center; |
||||
font-size: 28rpx; |
||||
} |
||||
.top input{ |
||||
border: 1rpx #333 solid; |
||||
height: 60rpx; |
||||
width: 700rpx; |
||||
border-radius: 5rpx; |
||||
padding: 5rpx 10rpx; |
||||
} |
||||
.top view{ |
||||
width: 305rpx; |
||||
margin-left: 20rpx; |
||||
background-color: #eee; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
border-radius: 10rpx; |
||||
color: #333; |
||||
font-weight: 700; |
||||
} |
||||
|
||||
.form{ |
||||
background-color: #fff; |
||||
border-radius: 15rpx; |
||||
padding: 0rpx 30rpx; |
||||
margin-bottom: 15rpx; |
||||
} |
||||
.form .from-con{ |
||||
font-size: 28rpx; |
||||
border-bottom: 2rpx #eee solid; |
||||
position: relative; |
||||
margin-top: 25rpx; |
||||
} |
||||
.from-con label{ |
||||
position: absolute; |
||||
top: 5rpx; |
||||
font-weight: 900; |
||||
font-size: 28rpx; |
||||
color: #333; |
||||
} |
||||
.from-con input{ |
||||
text-align: right; |
||||
padding: 10rpx; |
||||
} |
||||
.place{ |
||||
color:#c4bfbf; |
||||
} |
||||
|
||||
.bush{ |
||||
display: flex; |
||||
justify-content:space-between; |
||||
align-items: center; |
||||
} |
||||
.bush button{ |
||||
width: 200rpx !important; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
font-size: 28rpx; |
||||
background-color: #23c559; |
||||
color:#fff; |
||||
height: 55rpx; |
||||
} |
||||
.bush-img{ |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
justify-content:space-around; |
||||
padding: 20rpx 10rpx; |
||||
} |
||||
.bush-img image{ |
||||
width: 100rpx; |
||||
height: 100rpx; |
||||
margin-top: 5rpx; |
||||
border: 1rpx solid #999; |
||||
border-radius: 5rpx; |
||||
} |
||||
.back{ |
||||
margin-top: 15rpx; |
||||
} |
||||
|
||||
.con{ |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.con button{ |
||||
width: 170rpx !important; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
font-size: 28rpx; |
||||
background-color: rgb(245, 90, 90); |
||||
height: 55rpx; |
||||
margin-left: 10rpx !important; |
||||
} |
||||
|
||||
.tabel{ |
||||
margin-top: 20rpx; |
||||
width: 100%; |
||||
border: 1rpx #ddd solid; |
||||
|
||||
} |
||||
.tabel .tr{ |
||||
display: flex; |
||||
flex-wrap: nowrap; |
||||
white-space: nowrap; |
||||
} |
||||
.tr .td{ |
||||
border-right:#ddd solid 1rpx ; |
||||
border-top: #ddd solid 1rpx; |
||||
padding: 15rpx 0; |
||||
font-size: 22rpx; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
flex-wrap: nowrap; |
||||
white-space: nowrap; |
||||
min-width: 200rpx; |
||||
} |
||||
.tab-top view{ |
||||
background-color: #51bdbe; |
||||
color:#fff; |
||||
font-weight: 700; |
||||
font-size: 28rpx; |
||||
} |
||||
.td1{ |
||||
border-right:#ddd solid 1rpx ; |
||||
border-top: #ddd solid 1rpx; |
||||
padding: 15rpx 0; |
||||
font-size: 22rpx; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
flex-wrap: nowrap; |
||||
white-space: nowrap; |
||||
min-width: 100rpx; |
||||
} |
Loading…
Reference in new issue