|
|
@ -3,45 +3,44 @@ |
|
|
|
var datePicker = require('../../utils/dateSetting') |
|
|
|
var datePicker = require('../../utils/dateSetting') |
|
|
|
var request = require('../../utils/http') |
|
|
|
var request = require('../../utils/http') |
|
|
|
var dateUtils = require('../../utils/dateUtils') |
|
|
|
var dateUtils = require('../../utils/dateUtils') |
|
|
|
|
|
|
|
var app=getApp() |
|
|
|
|
|
|
|
|
|
|
|
//设定当前的时间,将其设定为常量
|
|
|
|
//设定当前的时间,将其设定为常量
|
|
|
|
Page({ |
|
|
|
Page({ |
|
|
|
data: { |
|
|
|
data: { |
|
|
|
pipenum: '', |
|
|
|
logno:'', |
|
|
|
selfOrderCode: '', //物流单号
|
|
|
|
|
|
|
|
ins: [], //送检机构 服务端获取
|
|
|
|
|
|
|
|
insName: '', //机构列表名称
|
|
|
|
|
|
|
|
insIdx: 0, //当前所选机构下标
|
|
|
|
|
|
|
|
bushList: ['自建物流'], //运输方式 服务端获取
|
|
|
|
|
|
|
|
bush: '0', //运输方式下标
|
|
|
|
|
|
|
|
date: '', //当天日期
|
|
|
|
|
|
|
|
start: '2020-01-01', |
|
|
|
|
|
|
|
end: '', |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boxArr:[],//转运箱列表
|
|
|
|
|
|
|
|
boxId:'',//转运箱id
|
|
|
|
boxNum: '', //转运箱号
|
|
|
|
boxNum: '', //转运箱号
|
|
|
|
boxList: [], //查询回来的转运箱列表
|
|
|
|
numberplateArr:[],//车辆列表
|
|
|
|
boxIdx: '', //选择的下标
|
|
|
|
numberplate:'',//车牌号
|
|
|
|
|
|
|
|
vehicleId:'',//车辆id
|
|
|
|
|
|
|
|
driverMen: '', //驾驶员
|
|
|
|
|
|
|
|
selfOrderCode: '', //物流单号
|
|
|
|
|
|
|
|
number: '', //数量
|
|
|
|
|
|
|
|
bushList: ['自建物流'], //运输方式 服务端获取
|
|
|
|
time: '', //出发时间
|
|
|
|
time: '', //出发时间
|
|
|
|
multiArray: [], |
|
|
|
multiArray: [], |
|
|
|
multiIndex: [0, 0, 0, 0, 0], |
|
|
|
multiIndex: [0, 0, 0, 0, 0], |
|
|
|
choose_year: "", |
|
|
|
choose_year: "", |
|
|
|
|
|
|
|
|
|
|
|
time1: '', //到达时间
|
|
|
|
time1: '', //到达时间
|
|
|
|
multiArray1: [], |
|
|
|
multiArray1: [], |
|
|
|
multiIndex1: [0, 0, 0, 0, 0], |
|
|
|
multiIndex1: [0, 0, 0, 0, 0], |
|
|
|
choose_year1: "", |
|
|
|
choose_year1: "", |
|
|
|
|
|
|
|
|
|
|
|
numberplate: '', //车牌号
|
|
|
|
|
|
|
|
numberplateIdx:'', //牌照角标
|
|
|
|
|
|
|
|
numberplateArr:[], //牌照号组
|
|
|
|
|
|
|
|
numberplateList:[], //车辆集合
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logisticsMen: '', //物流员
|
|
|
|
logisticsMen: '', //物流员
|
|
|
|
number: '', //数量
|
|
|
|
|
|
|
|
notes: '', //备注
|
|
|
|
notes: '', //备注
|
|
|
|
driverMen: '', //驾驶员
|
|
|
|
pipenum: '',//样本条码
|
|
|
|
// srcArray: [], //样本组?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ins: [], //送检机构 服务端获取
|
|
|
|
|
|
|
|
insName: '', //机构列表名称
|
|
|
|
|
|
|
|
insIdx: 0, //当前所选机构下标
|
|
|
|
|
|
|
|
bush: '0', //运输方式下标
|
|
|
|
|
|
|
|
date: '', //当天日期
|
|
|
|
|
|
|
|
start: '2020-01-01', |
|
|
|
|
|
|
|
end: '', |
|
|
|
|
|
|
|
srcArray: [], //样本组?
|
|
|
|
potoSrc: '../../images/addPoto.png', //默认图片
|
|
|
|
potoSrc: '../../images/addPoto.png', //默认图片
|
|
|
|
poto: [], //车辆&转运箱照片&样本 最大长度 12
|
|
|
|
poto: [], //车辆&转运箱照片&样本 最大长度 12
|
|
|
|
tableArr: [], //扫码表数据
|
|
|
|
tableArr: [], //扫码表数据
|
|
|
@ -50,12 +49,18 @@ Page({ |
|
|
|
sampleList: [], |
|
|
|
sampleList: [], |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//调用摄像头扫描样本码
|
|
|
|
//调用摄像头扫描样本码
|
|
|
|
scacode() { |
|
|
|
scacode() { |
|
|
|
wx.scanCode({ |
|
|
|
wx.scanCode({ |
|
|
|
success: (res) => { |
|
|
|
success: (res) => { |
|
|
|
|
|
|
|
var result=res.result |
|
|
|
|
|
|
|
if(result.length>20){ |
|
|
|
|
|
|
|
result=result.slice(5); |
|
|
|
|
|
|
|
console.log(result); |
|
|
|
|
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
pipenum: res.result |
|
|
|
pipenum:result |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
@ -283,11 +288,20 @@ Page({ |
|
|
|
goDetail(e) { |
|
|
|
goDetail(e) { |
|
|
|
console.log('goDetail=' + e.currentTarget.dataset.id); |
|
|
|
console.log('goDetail=' + e.currentTarget.dataset.id); |
|
|
|
var sample = this.data.sampleList[e.currentTarget.dataset.id] |
|
|
|
var sample = this.data.sampleList[e.currentTarget.dataset.id] |
|
|
|
|
|
|
|
console.log('==========',sample); |
|
|
|
wx.navigateTo({ |
|
|
|
wx.navigateTo({ |
|
|
|
url: '../details/details?sample=' + JSON.stringify(sample), |
|
|
|
url: '../details/details?sample=' + JSON.stringify(sample), |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//转运箱
|
|
|
|
|
|
|
|
bindPickerChangeBox(e){ |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
boxNum:this.data.boxArr[e.detail.value].boxNum, |
|
|
|
|
|
|
|
boxId:this.data.boxArr[e.detail.value].id |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//文本输入信息
|
|
|
|
//文本输入信息
|
|
|
|
inputTextInfo(e) { |
|
|
|
inputTextInfo(e) { |
|
|
|
var data_id = e.target.dataset.id; //组件tag
|
|
|
|
var data_id = e.target.dataset.id; //组件tag
|
|
|
@ -306,13 +320,6 @@ Page({ |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//转运箱号
|
|
|
|
|
|
|
|
if (data_id == 'boxNum') { |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
boxNum: value |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//物流员
|
|
|
|
//物流员
|
|
|
|
if (data_id == 'logisticsMen') { |
|
|
|
if (data_id == 'logisticsMen') { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
@ -335,30 +342,23 @@ Page({ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//转运箱号下拉选择
|
|
|
|
|
|
|
|
bindBoxNumber(e) { |
|
|
|
|
|
|
|
// console.log(JSON.stringify(e.detail.value))
|
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
boxIdx: e.detail.value, |
|
|
|
|
|
|
|
boxNum: this.data.boxList[e.detail.value] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//车辆下拉选择
|
|
|
|
//车辆下拉选择
|
|
|
|
bindNumberplate(e) { |
|
|
|
bindNumberplate(e) { |
|
|
|
// console.log(JSON.stringify(e.detail.value))
|
|
|
|
// console.log(JSON.stringify(e.detail.value))
|
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
numberplateIdx: e.detail.value, |
|
|
|
numberplate:this.data.numberplateArr[e.detail.value].numberplate, |
|
|
|
numberplate: this.data.numberplateArr[e.detail.value] |
|
|
|
vehicleId:this.data.numberplateArr[e.detail.value].id, |
|
|
|
|
|
|
|
driverMen:this.data.numberplateArr[e.detail.value].driverMen, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//显示必选项为空提示
|
|
|
|
//显示必选项为空提示
|
|
|
|
showErrInfo(field, errInfo) { |
|
|
|
showErrInfo(field, errInfo) { |
|
|
|
if (field === undefined || field.length == 0) { |
|
|
|
if (field === undefined || field.length == 0) { |
|
|
|
wx.showToast({ |
|
|
|
wx.showModal({ |
|
|
|
icon: 'error', |
|
|
|
showCancel:false, |
|
|
|
title: errInfo, |
|
|
|
title:'提示', |
|
|
|
|
|
|
|
content:errInfo, |
|
|
|
}) |
|
|
|
}) |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -373,7 +373,9 @@ Page({ |
|
|
|
var endTime = dateUtils.customizeDateFormat(temp.time1); |
|
|
|
var endTime = dateUtils.customizeDateFormat(temp.time1); |
|
|
|
|
|
|
|
|
|
|
|
if (this.showErrInfo(startTime, '出发时间不可为空')) return |
|
|
|
if (this.showErrInfo(startTime, '出发时间不可为空')) return |
|
|
|
if (this.showErrInfo(endTime, '到过时间不可为空')) return |
|
|
|
if (this.showErrInfo(endTime, '到达时间不可为空')) return |
|
|
|
|
|
|
|
if (this.showErrInfo(this.data.numberplate, '车牌号不可为空')) return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//处理物流车拍照
|
|
|
|
//处理物流车拍照
|
|
|
|
var carPoto = [] |
|
|
|
var carPoto = [] |
|
|
@ -395,25 +397,27 @@ Page({ |
|
|
|
var tempData = { |
|
|
|
var tempData = { |
|
|
|
"barCode": temp.pipenum, //样本条码
|
|
|
|
"barCode": temp.pipenum, //样本条码
|
|
|
|
"barCodeImg": "", //物流拍照图
|
|
|
|
"barCodeImg": "", //物流拍照图
|
|
|
|
|
|
|
|
"boxId":temp.boxId,//转运箱id
|
|
|
|
"boxNum": temp.boxNum, //转运箱号
|
|
|
|
"boxNum": temp.boxNum, //转运箱号
|
|
|
|
"carPics": carPoto.toString(), //物流车图片 逗号分隔
|
|
|
|
"carPics": carPoto.toString(), //物流车图片 逗号分隔
|
|
|
|
"boxPics": boxPoto.toString(), // 转运箱图片 逗号分隔
|
|
|
|
"boxPics": boxPoto.toString(), // 转运箱图片 逗号分隔
|
|
|
|
"cost": 0, // 物流费用 自建没有
|
|
|
|
"cost": 0, // 物流费用 自建没有
|
|
|
|
"driverMen": temp.driverMen, //驾驶员
|
|
|
|
"driverMen": temp.driverMen, //驾驶员
|
|
|
|
"entryDate": temp.date, // 录入日期
|
|
|
|
"entryDate": temp.date, // 录入日期
|
|
|
|
"endDate": '2023-07-06 14:52:53', //startTime
|
|
|
|
"endDate": '', //startTime
|
|
|
|
"expectedEndTime": endTime, //预计到达时间 endTime
|
|
|
|
"expectedEndTime": endTime, //预计到达时间 endTime
|
|
|
|
"institutionName": temp.insName, //送检机构名称
|
|
|
|
"institutionName": '', //送检机构名称
|
|
|
|
"institutionNo": temp.ins[temp.insIdx].id, //送检机构编号
|
|
|
|
"institutionNo": '', //送检机构编号
|
|
|
|
"logisticsMen": temp.logisticsMen, //物流员
|
|
|
|
"logisticsMen": temp.logisticsMen, //物流员
|
|
|
|
"logisticsNo": temp.selfOrderCode, //物流编号
|
|
|
|
"logisticsNo": temp.selfOrderCode, //物流编号
|
|
|
|
"logisticsWay": 1, //物流方式 1自建 2第三方 3货运
|
|
|
|
"logisticsWay": 1, //物流方式 1自建 2第三方 3货运
|
|
|
|
"notes": temp.notes, // 物流备注
|
|
|
|
"notes": temp.notes, // 物流备注
|
|
|
|
"number": temp.number, // 数量
|
|
|
|
"number": temp.number, // 数量
|
|
|
|
"numberplate": temp.numberplate, // 车牌号
|
|
|
|
"numberplate": temp.numberplate, // 车牌号
|
|
|
|
|
|
|
|
"vehicleId":temp.vehicleId,//车辆id
|
|
|
|
"phone": "", //物流电话
|
|
|
|
"phone": "", //物流电话
|
|
|
|
"startTime": startTime, //出发时间
|
|
|
|
"startTime": startTime, //出发时间
|
|
|
|
"tranType": "1", //物流方式
|
|
|
|
"tranType": "", //物流方式
|
|
|
|
"unitType": "", //物流单位 1.顺丰 2.京东(自建物流没有该字段)
|
|
|
|
"unitType": "", //物流单位 1.顺丰 2.京东(自建物流没有该字段)
|
|
|
|
"updateBy": 0, |
|
|
|
"updateBy": 0, |
|
|
|
"updateTime": "" |
|
|
|
"updateTime": "" |
|
|
@ -422,6 +426,9 @@ Page({ |
|
|
|
request.post(`/batch/addTranLogistics`, tempData).then(res => { |
|
|
|
request.post(`/batch/addTranLogistics`, tempData).then(res => { |
|
|
|
console.log(JSON.stringify(res.data)); |
|
|
|
console.log(JSON.stringify(res.data)); |
|
|
|
if (res.data.code == 200) { |
|
|
|
if (res.data.code == 200) { |
|
|
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
|
|
title: res.data.message, |
|
|
|
|
|
|
|
}) |
|
|
|
//保存成功后,查询底部列表
|
|
|
|
//保存成功后,查询底部列表
|
|
|
|
this.selSampleList(); |
|
|
|
this.selSampleList(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -450,10 +457,39 @@ Page({ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//退出
|
|
|
|
|
|
|
|
out(){ |
|
|
|
|
|
|
|
wx.switchTab({ |
|
|
|
|
|
|
|
url: '../index/index', |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
onLoad(options) { |
|
|
|
onLoad(options) { |
|
|
|
|
|
|
|
if(options!==undefined){ |
|
|
|
|
|
|
|
console.log(options.logno); |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
logno:options.logno |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.data.logno===undefined){ |
|
|
|
|
|
|
|
//获取物流单号 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(); //查询物流批次列表
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let now = new Date(); //获取时间
|
|
|
|
let now = new Date(); //获取时间
|
|
|
|
let year = now.getFullYear(); //获取当前年
|
|
|
|
let year = now.getFullYear(); //获取当前年
|
|
|
|
let month = now.getMonth() + 1; //获取当前月份
|
|
|
|
let month = now.getMonth() + 1; //获取当前月份
|
|
|
@ -477,17 +513,8 @@ Page({ |
|
|
|
], |
|
|
|
], |
|
|
|
}), |
|
|
|
}), |
|
|
|
|
|
|
|
|
|
|
|
//获取物流单号 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(); //查询物流批次列表
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取送检机构列表
|
|
|
|
//获取送检机构列表
|
|
|
@ -512,28 +539,17 @@ Page({ |
|
|
|
poto: tempSrc |
|
|
|
poto: tempSrc |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
//获取转运箱信息
|
|
|
|
//转运箱
|
|
|
|
request.post(`/box/selectTranBox`).then(res => { |
|
|
|
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({ |
|
|
|
this.setData({ |
|
|
|
boxList: tempBoxList |
|
|
|
boxArr:res.data.data |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
//获取车辆信息
|
|
|
|
//车牌号
|
|
|
|
request.post(`/vehicle/selectTranVehicle`).then(res => { |
|
|
|
request.post(`/vehicle/selectTranVehicle`).then(res => { |
|
|
|
var array = res.data.data |
|
|
|
|
|
|
|
var tempNumberplatArr = [] |
|
|
|
|
|
|
|
for (let index = 0; index < array.length; index++) { |
|
|
|
|
|
|
|
tempNumberplatArr.push(array[index].numberplate) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
numberplateArr :tempNumberplatArr |
|
|
|
numberplateArr:res.data.data |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -549,7 +565,13 @@ Page({ |
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
onShow() { |
|
|
|
onShow() { |
|
|
|
|
|
|
|
if(this.data.logno!=undefined){ |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
selfOrderCode:this.data.logno |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.selSampleList();
|
|
|
|
|
|
|
|
console.log(this.data.logno); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|