You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
192 lines
4.3 KiB
192 lines
4.3 KiB
2 years ago
|
// 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() {
|
||
|
|
||
|
}
|
||
|
})
|