diff --git a/app.js b/app.js
index caa4cff..431df83 100644
--- a/app.js
+++ b/app.js
@@ -3,7 +3,6 @@ App({
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
- logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
@@ -16,19 +15,21 @@ App({
globalData: {
// 本地环境
- baseUrl:'http://192.168.51.22:8201/mall-portal',
+ baseUrl: 'http://192.168.51.200:8201/mall-portal',
// 线上环境
// baseUrl:'https://portal-api.macrozheng.com',
token: '',
- userInfo:{},
- bindvx:null
+ userInfo: {},
+ bindvx: false,
+ openid: ''
},
- judLogin(){
+ //如果未登录提示跳转到等级界面
+ judLogin() {
wx.showModal({
title: '提示',
- content: '尊敬的用户您还未登录,请先登录',
- confirmText:'去登陆',
+ content: '您还未登录,请先登录',
+ confirmText: '去登陆',
complete: (res) => {
if (res.confirm) {
wx.navigateTo({
@@ -37,9 +38,8 @@ App({
};
if (res.cancel) {
console.log('用户点击取消');
- }
+ }
}
})
},
-
-})
+})
\ No newline at end of file
diff --git a/pages/about/about.js b/pages/about/about.js
index 7e7063e..e9b0834 100644
--- a/pages/about/about.js
+++ b/pages/about/about.js
@@ -1,25 +1,42 @@
// pages/about/about.js
+var request = require('../../utils/http')
+var login = require('../../utils/login')
+var app = getApp();
Page({
-
/**
* 页面的初始数据
*/
data: {
- username: '立即登录'
+ username: '立即登录',
+ isLogin: false, //是否登录
},
//绑定微信
bindWx() {
+ var isBindWx = ''
+ var content = ''
+ if (app.globalData.bindvx) {
+ //解绑
+ isBindWx = '解除绑定'
+ content = '平台账号已经与您微信账号绑定,是否进行解绑定?'
+ } else {
+ //绑定
+ isBindWx = '立刻绑定'
+ content = '平台账号将与您微信账号绑定,是否进行绑定?'
+ }
+
+
wx.showModal({
title: '绑定微信',
- content: '平台账号与微信账号绑定后,可以直接用微信进行登录,是否进行绑定?',
- confirmText: '绑定',
+ content: content,
+ confirmText: isBindWx,
complete: (res) => {
if (res.confirm) {
- wx.login({
- success: (res) => {
- console.log(res);
- },
+ login.bindWechat({
+ openid: app.globalData.openid
+ }).then(res1 => {
+ console.log('res=' + JSON.stringify(res1));
+ this.onLoad()
})
}
if (res.cancel) {
@@ -27,6 +44,7 @@ Page({
}
}
})
+
},
//查询跳转
@@ -67,12 +85,50 @@ Page({
})
},
+ //退出登录
+ outLogin() {
+ wx.showModal({
+ title: '提示',
+ content: '是否确定退出?',
+ complete: (res) => {
+ if (res.cancel) {
+
+ }
+
+ if (res.confirm) {
+ app.globalData.token = ''
+ app.globalData.userInfo = {}
+
+ this.setData({
+ isLogin: false,
+ username: '立即登录'
+ })
+ this.onLoad()
+ }
+ }
+ })
+
+
+ },
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
+ request.post('/sso/checkBind/' + app.globalData.openid).then(res2 => {
+ console.log('检查是否绑定=' + JSON.stringify(res2.data.data));
+ app.globalData.bindvx = res2.data.data
+ })
+
+ var userInfo = app.globalData.userInfo
+ console.log('userInfo' + JSON.stringify(app.globalData.userInfo));
+ if (userInfo != undefined && JSON.stringify(userInfo) != '{}') {
+ this.setData({
+ username: userInfo.nickname,
+ isLogin: true
+ })
+ }
},
/**
diff --git a/pages/about/about.wxml b/pages/about/about.wxml
index 946e53b..f94caff 100644
--- a/pages/about/about.wxml
+++ b/pages/about/about.wxml
@@ -34,6 +34,6 @@
- 退出登录
+ 退出登录
\ No newline at end of file
diff --git a/pages/feedback/feedback.wxml b/pages/feedback/feedback.wxml
index bf16c31..05364d5 100644
--- a/pages/feedback/feedback.wxml
+++ b/pages/feedback/feedback.wxml
@@ -15,7 +15,7 @@
* 上传图片/截图
-
+
{{item.text}}
diff --git a/pages/freiLogistics/freiLogistics.js b/pages/freiLogistics/freiLogistics.js
index 9118d07..ad55374 100644
--- a/pages/freiLogistics/freiLogistics.js
+++ b/pages/freiLogistics/freiLogistics.js
@@ -1,95 +1,100 @@
+//货运物流
var datePicker = require('../../utils/dateSetting')
+var request = require('../../utils/http')
+var dateUtils = require('../../utils/dateUtils')
Page({
data: {
- list:[
- {
- 'id':1,
- 'number':'2023050002',
- 'time':'2023-5-12 11:32',
- 'status':'已签收',
- 'name':'张三',
- 'num':'M2023055568'
- },
- {
- 'id':2,
- 'number':'2023050002',
- 'time':'2023-5-12 11:32',
- 'status':'已签收',
- 'name':'李四',
- 'num':'M2023055568'
+ selfOrderCode: '', //物流单号
+ sampleList: [{
+ 'id': 1,
+ 'number': '2023050002',
+ 'time': '2023-5-12 11:32',
+ 'status': '已签收',
+ 'name': '张三',
+ 'num': 'M2023055568'
}
],
- pipenum:'',
- ins: ['私家车','大巴',],
+ pipenum: '',
+ ins: [], //转运方式
+ insIdx: 0, //转运方式下标
date: '',
- start:'2020-01-01',
- end:'',
+ start: '2023-07-01',
+ end: '',
+
+ potoSrc: '../../images/addPoto.png', //默认图片
+ poto: [], //车辆&转运箱照片 最大长度 4
time: '',
multiArray: [],
multiIndex: [0, 0, 0, 0, 0],
choose_year: "",
- srcArray:[]
-
+ srcArray: [],
+ phone: '', //物流电话
+ boxNum: '', //转运箱号
+ cost: '', //物流费用
+ numberplate: '', //车牌号
+ logisticsMen: '', //物流员
+ notes: '', //备注
+ sampleCount: '0', //样本数量
+ //样本列表
+ sampleList: [{
+ 'id': 1,
+ 'number': '2023050002',
+ 'time': '2023-5-12 11:32',
+ 'status': '已签收',
+ 'name': '张三',
+ 'num': 'M2023055568'
+ }],
},
- scacode(){
+ scacode() {
wx.scanCode({
- success:(res)=>{
+ success: (res) => {
console.log(res.result);
this.setData({
- pipenum:res.result
+ pipenum: res.result
})
}
})
},
- phot(){
+ phot() {
wx.chooseMedia({
count: 1,
- mediaType: ['image','video'],
+ mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
- success: res=>{
+ success: res => {
console.log(this.data.srcI)
console.log(res.tempFiles[0].tempFilePath)
// this.up();
}
})
},
- //上传图片接口地址
- // up(){
- // console.log(this.data.srcI)
- // wx.uploadFile({
- // filePath: this.data.srcI,
- // name: 'file',
- // url: '',
- // })
- // },
- bushPhot(){
+ bushPhot() {
wx.chooseMedia({
count: 1,
- mediaType: ['image','video'],
+ mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
- success: res=>{
+ success: res => {
// this.up();
}
})
},
- boxPhot(){
+ boxPhot() {
wx.chooseMedia({
count: 1,
- mediaType: ['image','video'],
+ mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
- success: res=>{
+ success: res => {
// this.up();
}
})
@@ -103,10 +108,10 @@ Page({
},
//日期
- bindDateChange(e){
+ bindDateChange(e) {
// console.log(e.detail.value)
this.setData({
- date:e.detail.value
+ date: e.detail.value
})
},
@@ -153,12 +158,263 @@ Page({
- goDetail(){
+ goDetail() {
wx.navigateTo({
url: '../details/details',
})
},
+ //物流车拍照
+ bushPhot() {
+ wx.chooseMedia({
+ count: 1,
+ mediaType: ['image', 'video'],
+ sourceType: ['album', 'camera'],
+ maxDuration: 30,
+ camera: 'back',
+ success: res => {
+ // this.up();
+ }
+ })
+ },
+
+ //转运箱拍照
+ boxPhot(e) {
+ console.log(e.target.dataset.id);
+ wx.chooseMedia({
+ count: 1,
+ mediaType: ['image', 'video'],
+ sourceType: ['album', 'camera'],
+ maxDuration: 30,
+ camera: 'back',
+ success: res => {
+ // this.up();
+ }
+ })
+ },
+
+ //物流车、转运箱拍照
+ photograph(e) {
+ var potoIdx = 0;
+ if (e.target.dataset.id == 'car_1') potoIdx = 0
+ if (e.target.dataset.id == 'car_2') potoIdx = 1
+ if (e.target.dataset.id == 'box_1') potoIdx = 2
+ if (e.target.dataset.id == 'box_2') potoIdx = 3
+
+ //回显所拍摄照片
+ var _this = this;
+ wx.chooseMedia({
+ count: 1,
+ mediaType: ['image', 'video'],
+ sourceType: ['camera'],
+ sizeType: ['compressed'],
+ camera: 'back',
+ success: res => {
+ _this.upImg(res.tempFiles[0].tempFilePath, potoIdx) //上传照片
+ }
+ })
+ },
+
+ //上传照片 imageSrc照片临时路径 potoIdx 点击的哪一个图片框
+ upImg(imageSrc, potoIdx) {
+ var _this = this;
+ request.upImgFile(`/feedBack/upload`, imageSrc).then(res => {
+ var resObj = JSON.parse(res.data)
+ console.log('upImgFile data =' + resObj.data.url);
+ console.log('upImgFile res=' + JSON.stringify(res.data));
+ if (resObj.code > 400) {
+ wx.showModal({
+ title: '提示',
+ content: resObj.message,
+ complete: (res) => {
+ if (res.cancel) {}
+ if (res.confirm) {}
+ //上传失败后移除图片
+ }
+ })
+ } else {
+ //保存图片路径到数组
+ // this.data.upImageArr.push(resObj.data.url);
+ _this.data.poto[potoIdx] = resObj.data.url
+ _this.setData({
+ poto: _this.data.poto
+ })
+ }
+ });
+ },
+
+ //显示回调图片
+ addCallBackImage(imageSrc) {
+ var temp = {
+ isBtn: false,
+ imgUrl: imageSrc,
+ text: imageSrc,
+ func: "delImage"
+ };
+ this.data.imageArr.unshift(temp);
+ this.setData({
+ imageArr: this.data.imageArr
+ });
+ },
+
+ //保存样本信息
+ saveInfo() {
+ var temp = this.data;
+
+ //处理到达时间
+ var endTime = dateUtils.customizeDateFormat(temp.time);
+
+ if (this.showErrInfo(endTime, '到过时间不可为空')) return
+
+ //处理物流车拍照
+ var carPoto = []
+ var boxPoto = []
+ var array = this.data.poto;
+ for (let index = 0; index < array.length; index++) {
+ if (index < 2 && array[index] != this.data.potoSrc) {
+ carPoto.push(array[index])
+ } else if (array[index] != this.data.potoSrc) {
+ boxPoto.push(array[index])
+ }
+ }
+
+ var tempData = {
+ "barCode": temp.pipenum, //样本条码
+ "barCodeImg": "", //物流拍照图
+ "boxNum": temp.boxNum, //转运箱号
+ "carPics": carPoto.toString(), //物流车图片 逗号分隔
+ "boxPics": boxPoto.toString(), // 转运箱图片 逗号分隔
+ "cost": 0, // 物流费用 自建没有
+ "driverMen": temp.driverMen, //驾驶员
+ "entryDate": temp.date, // 录入日期
+ "endDate": '', //startTime
+ "expectedEndTime": endTime, //预计到达时间 endTime
+ "institutionName": temp.ins[temp.insIdx].orgName, //送检机构名称
+ "institutionNo": temp.ins[temp.insIdx].id, //送检机构编号
+ "logisticsMen": temp.logisticsMen, //物流员
+ "logisticsNo": temp.selfOrderCode, //物流编号
+ "logisticsWay": 1, //物流方式 1自建 2第三方 3货运
+ "notes": temp.notes, // 物流备注
+ "number": temp.number, // 数量
+ "numberplate": "", // 车牌号
+ "phone": "", //物流电话
+ "startTime": '', //出发时间
+ "tranType": "1", //物流方式
+ "unitType": "", //物流单位 1.顺丰 2.京东(自建物流没有该字段)
+ "updateBy": 0,
+ "updateTime": ""
+ }
+
+ request.post(`/batch/addTranLogistics`, tempData).then(res => {
+ console.log(JSON.stringify(res.data));
+ if (res.data.code == 200) {
+ //保存成功后,查询底部列表
+ this.selSampleList();
+ } else {
+ wx.showModal({
+ title: '错误',
+ content: res.data.message,
+ showCancel: false,
+ complete: (res) => {
+ if (res.confirm) {}
+ }
+ })
+ }
+ })
+ },
+
+ //查询底部列表数据
+ selSampleList() {
+ var reqData = {
+ 'logisticsNo': this.data.selfOrderCode
+ }
+ request.post(`/logistics/selectTranLogistics`, reqData).then(res => {
+ console.log(res.data);
+ this.setData({
+ sampleList: res.data.data,
+ sampleCount: res.data.data.length
+ })
+ })
+ },
+
+ //显示必选项为空提示
+ showErrInfo(field, errInfo) {
+ if (field === undefined || field.length == 0) {
+ wx.showToast({
+ icon: 'error',
+ title: errInfo,
+ })
+ return true;
+ }
+ },
+
+ //文本输入信息
+ inputTextInfo(e) {
+ var data_id = e.target.dataset.id; //组件tag
+ var value = e.detail.value; //输入的文本
+ //样本编号
+ if (data_id == 'barCode') {
+ this.setData({
+ pipenum: value
+ })
+ }
+
+ //数量
+ if (data_id == 'number') {
+ this.setData({
+ number: value
+ })
+ }
+
+ //转运箱号
+ if (data_id == 'boxNum') {
+ this.setData({
+ boxNum: value
+ })
+ }
+
+ //车牌号
+ if (data_id == 'numberplate') {
+ this.setData({
+ numberplate: value
+ })
+ }
+
+ if(data_id == 'phone'){
+ this.setData({
+ phone: value
+ })
+ }
+
+ //物流费用
+ if (data_id == 'cost') {
+ this.setData({
+ cost: value
+ })
+ }
+
+ //物流员
+ if (data_id == 'logisticsMen') {
+ this.setData({
+ logisticsMen: value
+ })
+ }
+
+ //驾驶员
+ if (data_id == 'driverMen') {
+ this.setData({
+ driverMen: value
+ })
+ }
+
+ //备注
+ if (data_id == 'notes') {
+ this.setData({
+ notes: value
+ })
+ }
+ },
+
/**
* 生命周期函数--监听页面加载
*/
@@ -167,18 +423,48 @@ Page({
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),//当前的时间
+ end: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2), //当前的时间
//开始
- multiArray:
- [
+ multiArray: [
[year + "年", year + 1 + "年", year + 2 + "年"],
datePicker.determineMonth(),
datePicker.determineDay(year, month),
datePicker.determineHour(),
datePicker.determineMinute()
],
- })
+ })
+
+ //获取物流单号 1.自建物流 2.第三方物流 3.货运物流
+ request.get(`/batch/getBatchsNumber?logisticsWay=3`).then(res => {
+ console.log('getBatchsNumber=' + JSON.stringify(res.data))
+ if (res.data.code == 200) {
+ this.setData({
+ selfOrderCode: res.data.data
+ })
+ }
+ })
+
+ //获取送检机构列表
+ request.get(`/dict/type/tran_method`).then(res => {
+ var array = res.data.data
+ var tempArr = []
+ for (let index = 0; index < array.length; index++) {
+ tempArr.push(array[index].dictLabel)
+ }
+ this.setData({
+ ins: tempArr
+ })
+
+ //查询物流批次列表
+ this.selSampleList();
+ })
+
+ //初始化照片按钮
+ var tempSrc = [this.data.potoSrc, this.data.potoSrc, this.data.potoSrc, this.data.potoSrc]
+ this.setData({
+ poto: tempSrc
+ })
},
/**
diff --git a/pages/freiLogistics/freiLogistics.wxml b/pages/freiLogistics/freiLogistics.wxml
index 7eae274..fcc433c 100644
--- a/pages/freiLogistics/freiLogistics.wxml
+++ b/pages/freiLogistics/freiLogistics.wxml
@@ -1,81 +1,86 @@
-
-
+
-
+
扫 码
- 拍 照
+
-
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
物流车拍照
-
+
-
-
+
+
转运箱拍照
-
+
-
-
+
+
- 总计:200/管数
-
-
+ 总计:{{sampleCount}}/管数
+
+
@@ -87,7 +92,7 @@
物流员
物流单号
-
+
{{item.id}}
{{item.number}}
{{item.time}}
@@ -97,5 +102,4 @@
-
-
+
\ No newline at end of file
diff --git a/pages/freiLogistics/freiLogistics.wxss b/pages/freiLogistics/freiLogistics.wxss
index 1b6c8d5..1fb312a 100644
--- a/pages/freiLogistics/freiLogistics.wxss
+++ b/pages/freiLogistics/freiLogistics.wxss
@@ -2,16 +2,18 @@
.top{
display: flex;
- justify-content: center;
+ justify-content: left;
font-size: 28rpx;
}
.top input{
border: 1rpx #333 solid;
- border-radius: 10rpx;
+ height: 60rpx;
+ width: 700rpx;
+ border-radius: 5rpx;
padding: 5rpx 10rpx;
}
.top view{
- width: 135rpx;
+ width: 305rpx;
margin-left: 20rpx;
background-color: #eee;
display: flex;
@@ -75,7 +77,7 @@
height: 230rpx;
margin-top: 10rpx;
border: 1rpx solid #999;
- /* border-radius: 15rpx; */
+ border-radius: 15rpx;
}
.back{
margin-top: 15rpx;
diff --git a/pages/handover/handover.js b/pages/handover/handover.js
index 685c89b..8d907d5 100644
--- a/pages/handover/handover.js
+++ b/pages/handover/handover.js
@@ -17,8 +17,7 @@ Page({
//刷新按钮
refresh() {
- this.onLoad()
- console.log("123");
+ this.selTranLogistics()
},
bindDateChange(e) {
@@ -35,11 +34,18 @@ Page({
pageSize: 100
}
request.post(`/batch/selectTranLogistics`, reqData).then(res => {
- console.log(JSON.stringify(res));
+ // console.log(JSON.stringify(res));
// this.data.logisticsCodeList = res.data.data
- this.setData({
- logisticsCodeList: res.data.data
- })
+ if (res.data.data.length == 0) {
+ wx.showToast({
+ title: '物流单列表无数据',
+ icon: 'error'
+ })
+ } else {
+ this.setData({
+ logisticsCodeList: res.data.data
+ })
+ }
})
},
@@ -120,10 +126,14 @@ Page({
let now = new Date(); //获取时间
let year = now.getFullYear(); //获取当前年
let month = now.getMonth() + 1; //获取当前月份
+ var tempDate = '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2);
this.setData({
- end: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
+ end: tempDate
}) //当前的时间
+ this.setData({
+ date: tempDate
+ })
this.selTranLogistics()
},
diff --git a/pages/handover/handover.wxml b/pages/handover/handover.wxml
index f16e31a..1b83d36 100644
--- a/pages/handover/handover.wxml
+++ b/pages/handover/handover.wxml
@@ -30,9 +30,9 @@
交接人
状态
-
+
- {{idx+1}}
+ {{index+1}}
{{item.barCode}}
{{item.institutionName}}
{{item.entryDate}}
@@ -51,7 +51,7 @@
-
+
diff --git a/pages/handover/handover.wxss b/pages/handover/handover.wxss
index 0c85af9..32e5de6 100644
--- a/pages/handover/handover.wxss
+++ b/pages/handover/handover.wxss
@@ -106,7 +106,7 @@
right: 0;
bottom: 0;
z-index: 10;
- background: rgba(0, 0, 0, 0);
+ background: rgba(0, 0, 0, 0.05);
/* 设置阴影半透明背景如: background: rgba(0, 0, 0, 0.4); */
display: none;
}
@@ -114,11 +114,11 @@
.zan-dialog__container {
position: fixed;
bottom: 200rpx;
- width: 350rpx;
+ width: 280rpx;
/* 弹窗布局宽 */
- height: 300rpx;
+ height: 280rpx;
/* 弹窗布局高,与下面弹出距离transform有关 */
- margin-left: 180rpx;
+ margin-left: 220rpx;
background: #f8f8f8;
transform: translateY(300%);
/* 弹框弹出距离,与弹框布局高度有关,如300%表示弹起距离为3倍弹窗高度 */
diff --git a/pages/index/index.js b/pages/index/index.js
index ba5dafe..0f8b159 100644
--- a/pages/index/index.js
+++ b/pages/index/index.js
@@ -1,5 +1,8 @@
// pages/index/index.js
+var request = require('../../utils/http')
import * as echarts from "../../components/echarts/echarts";
+var app = getApp();
+
function initChart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
@@ -7,8 +10,8 @@ function initChart(canvas, width, height, dpr) {
devicePixelRatio: dpr
});
canvas.setChart(chart);
-
- var option = {
+
+ var option = {
tooltip: {
trigger: 'axis',
axisPointer: {
@@ -23,16 +26,15 @@ function initChart(canvas, width, height, dpr) {
containLabel: true
},
xAxis: {
-
+
type: 'category',
- data: ['一月', '二月', '三月', '四月', '五月', '六月','七月','八月','九月','十一月','十二月']
+ data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十一月', '十二月']
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
- series: [
- {
+ series: [{
name: '核收数',
type: 'bar',
data: [10, 20, 46, 120, 90, 80]
@@ -45,7 +47,7 @@ function initChart(canvas, width, height, dpr) {
]
};
chart.setOption(option);
-
+
return chart;
};
@@ -58,44 +60,127 @@ Page({
ec: {
onInit: initChart
},
- msg:[], //首页中间消息列表
+ msg: [], //首页中间消息列表
},
//跳转对应界面
- goLogisticsType(e){
+ goLogisticsType(e) {
var tag = e.currentTarget.dataset.id
var url
//自建物流
- if(tag == 'goMelogistics'){
+ if (tag == 'goMelogistics') {
url = '../meLogistics/meLogistics'
}
//第三方
- if(tag == 'goThreelogistics'){
+ if (tag == 'goThreelogistics') {
url = '../threeLogistics/threeLogistics'
}
//货运
- if(tag == 'goLogistics'){
+ if (tag == 'goLogistics') {
url = '../freiLogistics/freiLogistics'
}
//物流交接
- if(tag == 'goHandover'){
+ if (tag == 'goHandover') {
url = '../handover/handover'
}
wx.navigateTo({
url: url,
})
},
-
+
+ //判读是否有token
+ isHaveToken() {
+ var token = app.globalData.token
+ if (token == undefined || token == '') {
+ app.judLogin();
+ } else {
+ console.log('用户已经登录');
+ console.log(JSON.stringify(token));
+ }
+ },
+
+ //判断是否绑定了微信
+ isBindWx(openid) {
+ request.post(`/sso/checkBind/${openid}`).then(res => {
+ console.log("是否绑定" + JSON.stringify(res));
+ if (res.data.data == true) {
+ //已绑定 获取用户信息
+ request.get('/sso/info').then(res1 => {
+ console.log('res1.data.data =' + JSON.stringify(res1.data.data));
+ app.globalData.userInfo = res1.data.data
+ // console.log(app.globalData.userInfo);
+ })
+ } else {
+ //未绑定 提示登录
+ app.judLogin();
+ }
+ })
+ },
+
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
+ if (app.globalData.userInfo == undefined) {
+ //获取code
+ wx.login({
+ success: res => {
+ // 发送 res.code 到后台换取 openId
+ request.get(`/wx/getOpenid?code=${res.code}`).then(res1 => {
+ //记录OpenID
+ app.globalData.openid = res1.data.openid
+ this.isBindWx(res1.data.openid)
+ })
+ }
+ })
+
+ //检查是否绑定
+ // request.post('/sso/checkBind/' + app.globalData.openid).then(res2 => {
+ // console.log('检查是否绑定=' + JSON.stringify(res2.data.data));
+ // app.globalData.bindvx = res2.data.data
+ // })
+ }
+
+
+
+ wx.login({
+ success: res => {
+ // 发送 res.code 到后台换取 openId, sessionKey, unionId
+ request.get(`/wx/getOpenid?code=${res.code}`).then(res1 => {
+
+ //记录OpenID
+ app.globalData.openid = res1.data.openid
+ this.isBindWx(res1.data.openid)
+ })
+
+ // console.log(JSON.stringify(res));
+ // if (res.errMsg == 'login:ok') {
+ // request.post(`/sso/checkBind/` + res.code).then(res => {
+ // console.log('res=' + JSON.stringify(res));
+ // if (res.data.code != 200) {
+ // //未绑定
+ // app.judLogin();
+ // } else {
+ // //已绑定 设置token 与 用户信息
+ // }
+ // })
+ // } else {
+ // wx.showToast({
+ // title: res.errMsg,
+ // icon: 'error'
+ // })
+ // }
+ }
+ })
+
},
+
+
/**
* 生命周期函数--监听页面初次渲染完成
*/
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
index 1c6dddf..ec06fa6 100644
--- a/pages/index/index.wxml
+++ b/pages/index/index.wxml
@@ -1,8 +1,5 @@
-
-
-
-
+
@@ -12,7 +9,7 @@
-
+
自建物流
@@ -33,6 +30,4 @@
-
-
\ No newline at end of file
diff --git a/pages/login/login.js b/pages/login/login.js
index 2fdf8f5..c396e27 100644
--- a/pages/login/login.js
+++ b/pages/login/login.js
@@ -8,8 +8,8 @@ Page({
* 页面的初始数据
*/
data: {
- username: "member", //账号
- userpwd: "member123", //密码
+ username: "yuexiangqian", //账号
+ userpwd: "123456", //密码
},
getUsername(e) {
this.setData({
@@ -27,14 +27,14 @@ Page({
console.log(res);
if (res.data.code == 200) {
app.globalData.token = res.data.data.tokenHead + res.data.data.token;
- wx.showToast({
- title: '登陆成功'
- })
- wx.reLaunch({
- url: '../about/about'
- });
request.get('/sso/info').then(res2 => {
app.globalData.userInfo = res2.data.data
+ wx.showToast({
+ title: '登陆成功'
+ })
+ wx.reLaunch({
+ url: '../about/about'
+ });
})
}
})
diff --git a/pages/meLogistics/meLogistics.js b/pages/meLogistics/meLogistics.js
index 1475f92..900bf53 100644
--- a/pages/meLogistics/meLogistics.js
+++ b/pages/meLogistics/meLogistics.js
@@ -1,7 +1,8 @@
// pages/meLogistics/meLogistics.js
-const datePicker = require('../../utils/dateSetting')
-const request = require('../../utils/http')
-const dateUtils = require('../../utils/dateUtils')
+//自建物流
+var datePicker = require('../../utils/dateSetting')
+var request = require('../../utils/http')
+var dateUtils = require('../../utils/dateUtils')
//设定当前的时间,将其设定为常量
Page({
@@ -33,37 +34,20 @@ Page({
number: '', //数量
notes: '', //备注
driverMen: '', //驾驶员
- srcArray: [], //样本组?
+ // srcArray: [], //样本组?
potoSrc: '../../images/addPoto.png', //默认图片
poto: [], //车辆&转运箱照片 最大长度 4
tableArr: [], //扫码表数据
sampleCount: '0', //样本数量
//样本列表
sampleList: [{
- 'id': 1,
- 'number': '2023050002',
- 'time': '2023-5-12 11:32',
- 'status': '已签收',
- 'name': '张三',
- 'num': 'M2023055568'
- },
- {
- 'id': 2,
- 'number': '2023050002',
- 'time': '2023-5-12 11:32',
- 'status': '已签收',
- 'name': '李四',
- 'num': 'M2023055568'
- },
- {
- 'id': 3,
- 'number': '2023050002',
- 'time': '2023-5-12 11:32',
- 'status': '已签收',
- 'name': '李四',
- 'num': 'M2023055568'
- }
- ],
+ 'id': 1,
+ 'number': '2023050002',
+ 'time': '2023-5-12 11:32',
+ 'status': '已签收',
+ 'name': '张三',
+ 'num': 'M2023055568'
+ }],
},
//调用摄像头
@@ -347,7 +331,7 @@ Page({
}
//备注
- if (data_id == 'notes') {
+ if (data_id == 'notes') {
this.setData({
notes: value
})
@@ -355,7 +339,7 @@ Page({
},
//显示必选项为空提示
- showErrInfo(field, errInfo){
+ showErrInfo(field, errInfo) {
if (field === undefined || field.length == 0) {
wx.showToast({
icon: 'error',
@@ -373,8 +357,8 @@ Page({
//处理到达时间
var endTime = dateUtils.customizeDateFormat(temp.time1);
- if(this.showErrInfo(startTime, '出发时间不可为空')) return
- if(this.showErrInfo(endTime, '到过时间不可为空')) return
+ if (this.showErrInfo(startTime, '出发时间不可为空')) return
+ if (this.showErrInfo(endTime, '到过时间不可为空')) return
//处理物流车拍照
var carPoto = []
diff --git a/pages/meLogistics/meLogistics.wxml b/pages/meLogistics/meLogistics.wxml
index 412677f..d3d3b6c 100644
--- a/pages/meLogistics/meLogistics.wxml
+++ b/pages/meLogistics/meLogistics.wxml
@@ -5,7 +5,7 @@
扫 码
- 拍 照
+
@@ -86,7 +86,7 @@
总计:{{sampleCount}}/管数
-
+
diff --git a/pages/meLogistics/meLogistics.wxss b/pages/meLogistics/meLogistics.wxss
index 8c0de8c..04d4b9e 100644
--- a/pages/meLogistics/meLogistics.wxss
+++ b/pages/meLogistics/meLogistics.wxss
@@ -2,16 +2,18 @@
.top{
display: flex;
- justify-content: center;
+ justify-content: left;
font-size: 28rpx;
}
.top input{
border: 1rpx #333 solid;
- border-radius: 10rpx;
+ height: 60rpx;
+ width: 700rpx;
+ border-radius: 5rpx;
padding: 5rpx 10rpx;
}
.top view{
- width: 135rpx;
+ width: 305rpx;
margin-left: 20rpx;
background-color: #eee;
display: flex;
diff --git a/pages/queryfrei/queryfrei.js b/pages/queryfrei/queryfrei.js
index 03f5a14..cfcd023 100644
--- a/pages/queryfrei/queryfrei.js
+++ b/pages/queryfrei/queryfrei.js
@@ -1,53 +1,140 @@
-// pages/queryfrei/queryfrei.js
-var app = getApp();
+//货运物流查询
+const request = require('../../utils/http')
Page({
/**
* 页面的初始数据
*/
data: {
- date: '',
- endDate:'',
- start:'2020-01-01',
- end:'',
-
- array: ['全部','xx卫生院','xx门诊',],
+ date: '', //开始时间
+ endDate: '',
+ start: '2023-01-01',
+ end: '',
+ logisticsNo: '', //物流单号
+ ins: [],
+ insName: '', //机构名称
+ insIdx: '', //默认机构所选下标
+ logisticsMen: '', //物流员
+ boxNum: '', //转运箱号
+ sampleList: [], //查询列表
+ sampleCount: '', //查询记录总数
},
//开始时间
- bindDateChange(e){
+ bindDateChange(e) {
// console.log(e.detail.value)
this.setData({
- date:e.detail.value
+ date: e.detail.value
})
},
//结束时间
- bindDateChangeend(e){
+ bindDateChangeend(e) {
// console.log(e.detail.value)
this.setData({
- endDate:e.detail.value
+ endDate: e.detail.value
})
},
- bindPickerChange (e) {
- // console.log( e.detail.value)
+ //物流员
+ bindLogisticsMen(e) {
this.setData({
- index: e.detail.value
+ logisticsMen: e.detail.value
})
},
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
+ //转运箱号
+ bindBoxNum(e) {
+ this.setData({
+ boxNum: e.detail.value
+ })
+ },
+
+ //送检机构
+ bindPickerChange(e) {
+ this.setData({
+ insName: this.data.ins[e.detail.value],
+ insIdx: e.detail.value
+ })
+ },
+
+ //获取物流单号
+ getLogisticsNo(e) {
+ this.setData({
+ logisticsNo: e.detail.value
+ })
+ },
+
+ //查询底部列表数据
+ selSampleList() {
+
+ var reqData = {
+ 'startDate': this.data.date,
+ 'endDate': this.data.endDate,
+ 'logisticsNo': this.data.logisticsNo,
+ 'institutionNo': this.data.ins[this.data.insIdx],
+ 'logisticsMen': this.data.logisticsMen,
+ 'boxNum': this.data.boxNum
+ }
+ request.post(`/logistics/selectTranLogistics`, reqData).then(res => {
+ if(res.data.data.length == 0){
+ wx.showToast({
+ title: '无查询结果',
+ icon: 'error'
+ })
+ } else {
+ this.setData({
+ sampleList: res.data.data,
+ sampleCount: res.data.data.length
+ })
+ }
+ })
+ },
+
+ //重置查询条件
+ resetting() {
+ this.currentTime()
+ this.setData({
+ logisticsNo: '',
+ insName: '',
+ logisticsMen: '',
+ boxNum: ''
+ })
+ },
+
+ //设置当前时间
+ currentTime() {
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),
+ date: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
+ endDate: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
}) //当前的时间
},
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ this.currentTime()
+
+
+ //获取送检机构列表
+ 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
+ })
+
+ //查询物流批次列表
+ // this.selSampleList();
+ })
+ },
+
/**
* 生命周期函数--监听页面初次渲染完成
diff --git a/pages/queryfrei/queryfrei.wxml b/pages/queryfrei/queryfrei.wxml
index f6a116d..0e4ae2c 100644
--- a/pages/queryfrei/queryfrei.wxml
+++ b/pages/queryfrei/queryfrei.wxml
@@ -1,67 +1,74 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- 序号
- 物流单号
- 送检机构
- 日期
- 物流费用
- 转运方式
-
-
- 1
- JD56549856
- XX卫生院
- 2023-5-12 14:32
- 10.00
- 私家车
-
-
- 2
- JD56549856
- XX卫生院
- 2023-5-12 14:32
- 10.00
- 私家车
-
-
-
+
+
+
+
+ 序号
+ 物流单号
+ 送检机构
+ 日期
+ 样本管数
+ 转运方式
+ 转运箱号
+ 出发时间
+ 到达时间
+ 车牌号
+ 备注
+
+
+
+ {{index + 1}}
+ {{item.logisticsNo}}
+ {{item.institutionName}}
+ {{item.entryDate}}
+ {{item.number}}
+
+ 私家车
+ 其他
+
+ {{item.boxNum}}
+ {{item.startTime}}
+ {{item.endTime}}
+ {{itme.numberplate}}
+ {{itme.notes}}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/queryfrei/queryfrei.wxss b/pages/queryfrei/queryfrei.wxss
index e600cf3..4e78062 100644
--- a/pages/queryfrei/queryfrei.wxss
+++ b/pages/queryfrei/queryfrei.wxss
@@ -1,4 +1,4 @@
-/* pages/queryfrei/queryfrei.wxss */
+
page{
background: -webkit-linear-gradient(top,#27adb0,#ebf7f7,#f1f1f1)
}
@@ -33,6 +33,7 @@ page{
display: flex;
margin-top: 20rpx;
}
+
.from-button button{
display: flex;
align-items: center;
@@ -48,8 +49,10 @@ page{
}
.tr .td{
- border-right:#ddd solid 1rpx ;
+ /* border-right:#ddd solid 1rpx ;
border-top: #ddd solid 1rpx;
+ border-bottom: #ddd solid 1rpx; */
+ border: 1rpx #ddd solid;
padding: 15rpx 0;
font-size: 22rpx;
display: flex;
@@ -66,6 +69,11 @@ page{
.td1{
min-width: 100rpx !important;
}
-.td2{
+.td_date{
min-width: 200rpx !important;
-}
\ No newline at end of file
+}
+.td_time{
+ min-width: 300rpx !important;
+}
+
+
diff --git a/pages/queryme/queryme.js b/pages/queryme/queryme.js
index 0404069..e5fd2a7 100644
--- a/pages/queryme/queryme.js
+++ b/pages/queryme/queryme.js
@@ -1,5 +1,5 @@
+//自建物流查询
const request = require('../../utils/http')
-var app = getApp();
Page({
/**
@@ -8,16 +8,16 @@ Page({
data: {
date: '', //开始时间
endDate: '',
- start: '2020-01-01',
+ start: '2023-01-01',
end: '',
logisticsNo: '', //物流单号
ins: [],
insName: '', //机构名称
insIdx: '', //默认机构所选下标
- logisticsMen:'', //物流员
- boxNum:'', //转运箱号
- sampleList:[], //查询列表
- sampleCount:'', //查询记录总数
+ logisticsMen: '', //物流员
+ boxNum: '', //转运箱号
+ sampleList: [], //查询列表
+ sampleCount: '', //查询记录总数
},
//开始时间
@@ -36,14 +36,14 @@ Page({
},
//物流员
- bindLogisticsMen(e){
+ bindLogisticsMen(e) {
this.setData({
logisticsMen: e.detail.value
})
},
//转运箱号
- bindBoxNum(e){
+ bindBoxNum(e) {
this.setData({
boxNum: e.detail.value
})
@@ -51,10 +51,9 @@ Page({
//送检机构
bindPickerChange(e) {
- console.log('bindPickerChange=' + e.detail.value)
this.setData({
insName: this.data.ins[e.detail.value],
- insIdx:e.detail.value
+ insIdx: e.detail.value
})
},
@@ -70,25 +69,40 @@ Page({
var reqData = {
'startDate': this.data.date,
- 'endDate' : this.data.endDate,
+ 'endDate': this.data.endDate,
'logisticsNo': this.data.logisticsNo,
'institutionNo': this.data.ins[this.data.insIdx],
- 'logisticsMen':this.data.logisticsMen,
- 'boxNum':this.data.boxNum
+ 'logisticsMen': this.data.logisticsMen,
+ 'boxNum': this.data.boxNum
}
request.post(`/logistics/selectTranLogistics`, reqData).then(res => {
- console.log(res.data);
- this.setData({
- sampleList: res.data.data,
- sampleCount: res.data.data.length
- })
+ if(res.data.data.length == 0){
+ wx.showToast({
+ title: '无查询结果',
+ icon: 'error'
+ })
+ } else {
+ this.setData({
+ sampleList: res.data.data,
+ sampleCount: res.data.data.length
+ })
+ }
})
},
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
+ //重置查询条件
+ resetting() {
+ this.currentTime()
+ this.setData({
+ logisticsNo: '',
+ insName: '',
+ logisticsMen: '',
+ boxNum: ''
+ })
+ },
+
+ //设置当前时间
+ currentTime() {
let now = new Date(); //获取时间
let year = now.getFullYear(); //获取当前年
let month = now.getMonth() + 1; //获取当前月份
@@ -96,6 +110,13 @@ Page({
date: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
endDate: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
}) //当前的时间
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ this.currentTime()
//获取送检机构列表
diff --git a/pages/queryme/queryme.wxml b/pages/queryme/queryme.wxml
index e81c15c..56eb443 100644
--- a/pages/queryme/queryme.wxml
+++ b/pages/queryme/queryme.wxml
@@ -11,7 +11,7 @@
-
+
@@ -26,7 +26,7 @@
-
+
@@ -38,26 +38,32 @@
序号
物流单号
送检机构
- 日期
+ 日期
样本管数
- 送检机构
-
-
- 1
- JD56549856
- XX卫生院
- 2023-5-12 14:32
- 10
- 私家车
+ 转运方式
+ 转运箱号
+ 出发时间
+ 到达时间
+ 车牌号
+ 备注
-
+
+
- 2
- JD56549856
- XX卫生院
- 2023-5-12 14:32
- 10
- 私家车
+ {{index + 1}}
+ {{item.logisticsNo}}
+ {{item.institutionName}}
+ {{item.entryDate}}
+ {{item.number}}
+
+ 私家车
+ 其他
+
+ {{item.boxNum}}
+ {{item.startTime}}
+ {{item.endTime}}
+ {{itme.numberplate}}
+ {{itme.notes}}
diff --git a/pages/queryme/queryme.wxss b/pages/queryme/queryme.wxss
index b2d614b..4e78062 100644
--- a/pages/queryme/queryme.wxss
+++ b/pages/queryme/queryme.wxss
@@ -69,8 +69,11 @@ page{
.td1{
min-width: 100rpx !important;
}
-.td2{
+.td_date{
min-width: 200rpx !important;
}
+.td_time{
+ min-width: 300rpx !important;
+}
diff --git a/pages/querythree/querythree.js b/pages/querythree/querythree.js
index d8a5abf..e5fd2a7 100644
--- a/pages/querythree/querythree.js
+++ b/pages/querythree/querythree.js
@@ -1,53 +1,140 @@
-// pages/querythree/querythree.js
-var app = getApp();
+//自建物流查询
+const request = require('../../utils/http')
Page({
/**
* 页面的初始数据
*/
data: {
- date: '',
- endDate:'',
- start:'2020-01-01',
- end:'',
-
- array: ['全部','xx卫生院','xx门诊',],
+ date: '', //开始时间
+ endDate: '',
+ start: '2023-01-01',
+ end: '',
+ logisticsNo: '', //物流单号
+ ins: [],
+ insName: '', //机构名称
+ insIdx: '', //默认机构所选下标
+ logisticsMen: '', //物流员
+ boxNum: '', //转运箱号
+ sampleList: [], //查询列表
+ sampleCount: '', //查询记录总数
},
//开始时间
- bindDateChange(e){
+ bindDateChange(e) {
// console.log(e.detail.value)
this.setData({
- date:e.detail.value
+ date: e.detail.value
})
},
//结束时间
- bindDateChangeend(e){
+ bindDateChangeend(e) {
// console.log(e.detail.value)
this.setData({
- endDate:e.detail.value
+ endDate: e.detail.value
})
},
- bindPickerChange (e) {
- // console.log( e.detail.value)
+ //物流员
+ bindLogisticsMen(e) {
this.setData({
- index: e.detail.value
+ logisticsMen: e.detail.value
})
},
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
+ //转运箱号
+ bindBoxNum(e) {
+ this.setData({
+ boxNum: e.detail.value
+ })
+ },
+
+ //送检机构
+ bindPickerChange(e) {
+ this.setData({
+ insName: this.data.ins[e.detail.value],
+ insIdx: e.detail.value
+ })
+ },
+
+ //获取物流单号
+ getLogisticsNo(e) {
+ this.setData({
+ logisticsNo: e.detail.value
+ })
+ },
+
+ //查询底部列表数据
+ selSampleList() {
+
+ var reqData = {
+ 'startDate': this.data.date,
+ 'endDate': this.data.endDate,
+ 'logisticsNo': this.data.logisticsNo,
+ 'institutionNo': this.data.ins[this.data.insIdx],
+ 'logisticsMen': this.data.logisticsMen,
+ 'boxNum': this.data.boxNum
+ }
+ request.post(`/logistics/selectTranLogistics`, reqData).then(res => {
+ if(res.data.data.length == 0){
+ wx.showToast({
+ title: '无查询结果',
+ icon: 'error'
+ })
+ } else {
+ this.setData({
+ sampleList: res.data.data,
+ sampleCount: res.data.data.length
+ })
+ }
+ })
+ },
+
+ //重置查询条件
+ resetting() {
+ this.currentTime()
+ this.setData({
+ logisticsNo: '',
+ insName: '',
+ logisticsMen: '',
+ boxNum: ''
+ })
+ },
+
+ //设置当前时间
+ currentTime() {
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),
+ date: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
+ endDate: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2),
}) //当前的时间
},
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ this.currentTime()
+
+
+ //获取送检机构列表
+ 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
+ })
+
+ //查询物流批次列表
+ // this.selSampleList();
+ })
+ },
+
/**
* 生命周期函数--监听页面初次渲染完成
diff --git a/pages/querythree/querythree.wxml b/pages/querythree/querythree.wxml
index 5ba2a89..a33f6f9 100644
--- a/pages/querythree/querythree.wxml
+++ b/pages/querythree/querythree.wxml
@@ -1,41 +1,40 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
序号
物流单号
送检机构
@@ -43,25 +42,22 @@
物流费用
转运方式
-
- 1
- JD56549856
- XX卫生院
- 2023-5-12 14:32
- 10.00
- 私家车
-
-
- 2
- JD56549856
- XX卫生院
- 2023-5-12 14:32
- 10.00
- 私家车
-
+
+
+ {{index + 1}}
+ {{item.logisticsNo}}
+ {{item.institutionName}}
+ {{item.entryDate}}
+ {{item.cost}}
+
+ 私家车
+ 其他
+
+
+
-
+
\ No newline at end of file
diff --git a/pages/querythree/querythree.wxss b/pages/querythree/querythree.wxss
index d326a0b..4e78062 100644
--- a/pages/querythree/querythree.wxss
+++ b/pages/querythree/querythree.wxss
@@ -1,4 +1,4 @@
-/* pages/querythree/querythree.wxss */
+
page{
background: -webkit-linear-gradient(top,#27adb0,#ebf7f7,#f1f1f1)
}
@@ -33,6 +33,7 @@ page{
display: flex;
margin-top: 20rpx;
}
+
.from-button button{
display: flex;
align-items: center;
@@ -49,7 +50,8 @@ page{
}
.tr .td{
/* border-right:#ddd solid 1rpx ;
- border-top: #ddd solid 1rpx; */
+ border-top: #ddd solid 1rpx;
+ border-bottom: #ddd solid 1rpx; */
border: 1rpx #ddd solid;
padding: 15rpx 0;
font-size: 22rpx;
@@ -67,6 +69,11 @@ page{
.td1{
min-width: 100rpx !important;
}
-.td2{
+.td_date{
min-width: 200rpx !important;
}
+.td_time{
+ min-width: 300rpx !important;
+}
+
+
diff --git a/pages/threeLogistics/threeLogistics.js b/pages/threeLogistics/threeLogistics.js
index 3334f3b..fdc5e3a 100644
--- a/pages/threeLogistics/threeLogistics.js
+++ b/pages/threeLogistics/threeLogistics.js
@@ -1,95 +1,216 @@
+//第三方物流
var datePicker = require('../../utils/dateSetting')
-
+var request = require('../../utils/http')
+var dateUtils = require('../../utils/dateUtils')
Page({
data: {
- list:[
- {
- 'id':1,
- 'number':'2023050002',
- 'time':'2023-5-12 11:32',
- 'status':'已签收',
- 'name':'张三',
- 'num':'M2023055568'
- },
- {
- 'id':2,
- 'number':'2023050002',
- 'time':'2023-5-12 11:32',
- 'status':'已签收',
- 'name':'李四',
- 'num':'M2023055568'
- }
- ],
- pipenum:'',
- ins: ['顺丰','京东',],
+ selfOrderCode: '', //物流单号
+ list: [{
+ 'id': 1,
+ 'number': '2023050002',
+ 'time': '2023-5-12 11:32',
+ 'status': '已签收',
+ 'name': '张三',
+ 'num': 'M2023055568'
+ }],
+ pipenum: '',
+ ins: [],
+ insIdx: 0, //物流所选下标
date: '',
- start:'2020-01-01',
- end:'',
+ start: '2023-07-01', // 时间选择器开始时间
+ end: '', // 时间选择器结束时间
+
+ potoSrc: '../../images/addPoto.png', //默认图片
+ poto: [], //车辆&转运箱照片 最大长度 4
- time: '',
+ expectedEndTime: '', //预计到达时间
multiArray: [],
multiIndex: [0, 0, 0, 0, 0],
choose_year: "",
- srcArray:[]
+ srcArray: [],
+ phone: '', //物流电话
+ boxNum: '', //转运箱号
+ cost: '', //物流费用
+ logisticsMen: '', //物流员
+ notes: '', //备注
+
+ sampleCount: '0', //样本数量
+ //样本列表
+ sampleList: [{
+ 'id': 1,
+ 'number': '2023050002',
+ 'time': '2023-5-12 11:32',
+ 'status': '已签收',
+ 'name': '张三',
+ 'num': 'M2023055568'
+ }],
+ },
+
+ //物流车、转运箱拍照
+ photograph(e) {
+ var potoIdx = 0;
+ if (e.target.dataset.id == 'car_1') potoIdx = 0
+ if (e.target.dataset.id == 'car_2') potoIdx = 1
+ if (e.target.dataset.id == 'box_1') potoIdx = 2
+ if (e.target.dataset.id == 'box_2') potoIdx = 3
+
+ //回显所拍摄照片
+ var _this = this;
+ wx.chooseMedia({
+ count: 1,
+ mediaType: ['image', 'video'],
+ sourceType: ['camera'],
+ sizeType: ['compressed'],
+ camera: 'back',
+ success: res => {
+ _this.upImg(res.tempFiles[0].tempFilePath, potoIdx) //上传照片
+ }
+ })
+ },
+ //上传照片 imageSrc照片临时路径 potoIdx 点击的哪一个图片框
+ upImg(imageSrc, potoIdx) {
+ var _this = this;
+ request.upImgFile(`/feedBack/upload`, imageSrc).then(res => {
+ var resObj = JSON.parse(res.data)
+ console.log('upImgFile data =' + resObj.data.url);
+ console.log('upImgFile res=' + JSON.stringify(res.data));
+ if (resObj.code > 400) {
+ wx.showModal({
+ title: '提示',
+ content: resObj.message,
+ complete: (res) => {
+ if (res.cancel) {}
+ if (res.confirm) {}
+ //上传失败后移除图片
+ }
+ })
+ } else {
+ //保存图片路径到数组
+ // this.data.upImageArr.push(resObj.data.url);
+ _this.data.poto[potoIdx] = resObj.data.url
+ _this.setData({
+ poto: _this.data.poto
+ })
+ }
+ });
},
- scacode(){
+ //显示回调图片
+ addCallBackImage(imageSrc) {
+ var temp = {
+ isBtn: false,
+ imgUrl: imageSrc,
+ text: imageSrc,
+ func: "delImage"
+ };
+ this.data.imageArr.unshift(temp);
+ this.setData({
+ imageArr: this.data.imageArr
+ });
+ },
+
+ //文本输入信息
+ inputTextInfo(e) {
+ var data_id = e.target.dataset.id; //组件tag
+ var value = e.detail.value; //输入的文本
+ //样本编号
+ if (data_id == 'barCode') {
+ this.setData({
+ pipenum: value
+ })
+ }
+
+ //物流电话
+ if (data_id == 'phone') {
+ this.setData({
+ phone: value
+ })
+ }
+
+ //转运箱号
+ if (data_id == 'boxNum') {
+ this.setData({
+ boxNum: value
+ })
+ }
+
+ //物流费用
+ if (data_id == 'cost') {
+ this.setData({
+ cost: value
+ })
+ }
+
+ //物流员
+ if (data_id == 'logisticsMen') {
+ this.setData({
+ logisticsMen: value
+ })
+ }
+
+ //驾驶员
+ if (data_id == 'driverMen') {
+ this.setData({
+ driverMen: value
+ })
+ }
+
+ //备注
+ if (data_id == 'notes') {
+ this.setData({
+ notes: value
+ })
+ }
+ },
+
+ scacode() {
wx.scanCode({
- success:(res)=>{
+ success: (res) => {
console.log(res.result);
this.setData({
- pipenum:res.result
+ pipenum: res.result
})
}
})
},
- phot(){
+ phot() {
wx.chooseMedia({
count: 1,
- mediaType: ['image','video'],
+ mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
- success: res=>{
+ success: res => {
console.log(this.data.srcI)
console.log(res.tempFiles[0].tempFilePath)
// this.up();
}
})
},
- //上传图片接口地址
- // up(){
- // console.log(this.data.srcI)
- // wx.uploadFile({
- // filePath: this.data.srcI,
- // name: 'file',
- // url: '',
- // })
- // },
- bushPhot(){
+ bushPhot() {
wx.chooseMedia({
count: 1,
- mediaType: ['image','video'],
+ mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
- success: res=>{
+ success: res => {
// this.up();
}
})
},
- boxPhot(){
+ boxPhot() {
wx.chooseMedia({
count: 1,
- mediaType: ['image','video'],
+ mediaType: ['image', 'video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
- success: res=>{
+ success: res => {
// this.up();
}
})
@@ -97,16 +218,18 @@ Page({
//送检机构
bindPickerChange(e) {
+ console.log('bindPickerChange = ' + JSON.stringify(e));
this.setData({
- index: e.detail.value
+ index: e.detail.value,
+ insIdx:e.detail.value
})
},
//日期
- bindDateChange(e){
+ bindDateChange(e) {
// console.log(e.detail.value)
this.setData({
- date:e.detail.value
+ date: e.detail.value
})
},
@@ -118,7 +241,7 @@ Page({
this.data.multiArray[3][this.data.multiIndex[3]] +
this.data.multiArray[4][this.data.multiIndex[4]];
this.setData({
- time: dateStr
+ expectedEndTime: dateStr
})
},
@@ -150,15 +273,106 @@ Page({
})
},
+ //查询底部列表数据
+ selSampleList() {
+ var reqData = {
+ 'logisticsNo': this.data.selfOrderCode
+ }
+ request.post(`/logistics/selectTranLogistics`, reqData).then(res => {
+ console.log(res.data);
+ this.setData({
+ sampleList: res.data.data,
+ sampleCount: res.data.data.length
+ })
+ })
+ },
-
- goDetail(){
+ goDetail() {
wx.navigateTo({
url: '../details/details',
})
},
+ //保存样本信息
+ saveInfo() {
+ var temp = this.data;
+ //处理出发时间
+ // var startTime = dateUtils.customizeDateFormat(temp.time);
+ //处理到达时间
+ var endTime = dateUtils.customizeDateFormat(temp.expectedEndTime);
+
+ // if (this.showErrInfo(startTime, '出发时间不可为空')) return
+ if (this.showErrInfo(endTime, '到过时间不可为空')) return
+
+ //处理物流车拍照
+ var carPoto = []
+ var boxPoto = []
+ var array = this.data.poto;
+ for (let index = 0; index < array.length; index++) {
+ if (index < 2 && array[index] != this.data.potoSrc) {
+ carPoto.push(array[index])
+ } else if (array[index] != this.data.potoSrc) {
+ boxPoto.push(array[index])
+ }
+ }
+
+ var tempData = {
+ "barCode": temp.pipenum, //样本条码
+ "barCodeImg": "", //物流拍照图
+ "boxNum": temp.boxNum, //转运箱号
+ "carPics": carPoto.toString(), //物流车图片 逗号分隔
+ "boxPics": boxPoto.toString(), // 转运箱图片 逗号分隔
+ "cost": 0, // 物流费用
+ "driverMen": temp.driverMen, //驾驶员
+ "entryDate": temp.date, // 录入日期
+ "endDate": '2023-07-06 14:52:53', //startTime
+ "expectedEndTime": endTime, //预计到达时间 endTime
+ "institutionName": temp.ins[temp.insIdx].orgName, //送检机构名称
+ "institutionNo": temp.ins[temp.insIdx].id, //送检机构编号
+ "logisticsMen": temp.logisticsMen, //物流员
+ "logisticsNo": temp.selfOrderCode, //物流编号
+ "logisticsWay": 2, //物流方式 1自建 2第三方 3货运
+ "notes": temp.notes, // 物流备注
+ "number": temp.number, // 数量
+ "numberplate": "", // 车牌号
+ "phone": temp.phone, //物流电话
+ "startTime": "", //出发时间
+ "tranType": "", //物流方式
+ "unitType": temp.insIdx, //物流单位 1.顺丰 2.京东
+ "updateBy": 0,
+ "updateTime": ""
+ }
+
+ request.post(`/batch/addTranLogistics`, tempData).then(res => {
+ console.log(JSON.stringify(res.data));
+ if (res.data.code == 200) {
+ //保存成功后,查询底部列表
+ this.selSampleList();
+ } else {
+ wx.showModal({
+ title: '错误',
+ content: res.data.message,
+ showCancel: false,
+ complete: (res) => {
+ if (res.confirm) {}
+ }
+ })
+ }
+ })
+ },
+
+ //显示必选项为空提示
+ showErrInfo(field, errInfo) {
+ if (field === undefined || field.length == 0) {
+ wx.showToast({
+ icon: 'error',
+ title: errInfo,
+ })
+ return true;
+ }
+ },
+
/**
* 生命周期函数--监听页面加载
*/
@@ -167,18 +381,51 @@ Page({
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),//当前的时间
+ end: '' + year + '-' + (Array(2).join(0) + month).slice(-2) + '-' + (Array(2).join(0) + now.getDate()).slice(-2), //当前的时间
//开始
- multiArray:
- [
+ multiArray: [
[year + "年", year + 1 + "年", year + 2 + "年"],
datePicker.determineMonth(),
datePicker.determineDay(year, month),
datePicker.determineHour(),
datePicker.determineMinute()
],
- })
+ })
+
+
+ //获取物流单号 1.自建物流 2.第三方物流 3.货运物流
+ request.get(`/batch/getBatchsNumber?logisticsWay=2`).then(res => {
+ console.log('getBatchsNumber=' + JSON.stringify(res.data))
+ if (res.data.code == 200) {
+ this.setData({
+ selfOrderCode: res.data.data
+ })
+ }
+ })
+
+ //获取物流机构列表 /dict/type/{dictType}
+ request.get(`/dict/type/unit_type`).then(res => {
+ var array = res.data.data
+ var tempArr = []
+ for (let index = 0; index < array.length; index++) {
+ tempArr.push(array[index].dictLabel)
+ }
+
+ this.setData({
+ ins: tempArr
+ })
+
+ //查询物流批次列表
+ this.selSampleList()
+ })
+
+ //初始化照片按钮
+ var tempSrc = [this.data.potoSrc, this.data.potoSrc, this.data.potoSrc, this.data.potoSrc]
+ this.setData({
+ poto: tempSrc
+ })
+
},
/**
diff --git a/pages/threeLogistics/threeLogistics.wxml b/pages/threeLogistics/threeLogistics.wxml
index 9177ae7..4c4b5e9 100644
--- a/pages/threeLogistics/threeLogistics.wxml
+++ b/pages/threeLogistics/threeLogistics.wxml
@@ -1,80 +1,79 @@
-
-
+
-
+
扫 码
- 拍 照
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
物流车拍照
-
+
-
-
+
+
转运箱拍照
-
+
-
-
+
+
总计:200/管数
-
-
+
+
@@ -86,7 +85,7 @@
物流员
物流单号
-
+
{{item.id}}
{{item.number}}
{{item.time}}
@@ -97,4 +96,4 @@
-
+
\ No newline at end of file
diff --git a/pages/threeLogistics/threeLogistics.wxss b/pages/threeLogistics/threeLogistics.wxss
index 4c85cb3..84e27f7 100644
--- a/pages/threeLogistics/threeLogistics.wxss
+++ b/pages/threeLogistics/threeLogistics.wxss
@@ -7,11 +7,13 @@
}
.top input{
border: 1rpx #333 solid;
- border-radius: 10rpx;
+ height: 60rpx;
+ width: 700rpx;
+ border-radius: 5rpx;
padding: 5rpx 10rpx;
}
.top view{
- width: 135rpx;
+ width: 305rpx;
margin-left: 20rpx;
background-color: #eee;
display: flex;
diff --git a/utils/dateSetting.js b/utils/dateSetting.js
index a8b208a..4b28fef 100644
--- a/utils/dateSetting.js
+++ b/utils/dateSetting.js
@@ -1,10 +1,9 @@
-
//将当前日期写成常量
// 测试
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1;
-const day = date.getDay()+1;
+const day = date.getDay() + 9; //不知道为什么 + 1 的话,时间不是当前日
const hour = date.getHours();
const minute = date.getMinutes();
//确定月份呈现
@@ -43,12 +42,14 @@ function determineDay(year, month) {
days = 28
} else days = 29;
}
+
for (let i = day; i <= days; i++) {
dayDates.push(i + "日");
}
for (let i = 1; i <= day; i++) {
dayDates.push(i + "日");
}
+
return dayDates;
}
//确定小时的呈现
@@ -65,7 +66,7 @@ function determineHour() {
//确定分的呈现
function determineMinute() {
let minuteDates = [];
- let minuteNum=0;
+ let minuteNum = 0;
if (parseInt(minute) % 10 >= 5) {
minuteNum = (parseInt(minute / 10) + 1) * 10;
} else {
@@ -81,8 +82,8 @@ function determineMinute() {
}
//将上述函数导出,这样引入文件后可以直接使用导出的函数
module.exports = {
- determineMonth:determineMonth,
- determineDay:determineDay,
- determineHour:determineHour,
- determineMinute:determineMinute,
-}
+ determineMonth: determineMonth,
+ determineDay: determineDay,
+ determineHour: determineHour,
+ determineMinute: determineMinute,
+}
\ No newline at end of file
diff --git a/utils/login.js b/utils/login.js
new file mode 100644
index 0000000..6dde0c5
--- /dev/null
+++ b/utils/login.js
@@ -0,0 +1,37 @@
+const request = require('../utils/http')
+var app = getApp();
+const openidLogin = function(){
+ wx.login({
+ success: (res) => {
+ request.get('/wx/getOpenid?code='+res.code).then(res => {
+ getTokenByOpenld({openid: res.data.openid}).then(res1 => {
+ // console.log('=============',res1);
+ if(res1.data.code == 200){
+ app.globalData.token = res1.data.data.tokenHead + res1.data.data.token;
+ // console.log(app.globalData.token);
+ wx.showToast({
+ title: '登陆成功'
+ });
+ request.get('/sso/info').then(res2 => {
+ // console.log(res2);
+ app.globalData.userInfo=res2.data.data
+ // console.log(app.globalData.userInfo);
+ })
+ }
+ })
+ })
+
+ }
+ })
+}
+const getTokenByOpenld = function(params){
+ return request.post('/sso/getTokenByOpenId', params, {'content-type':'application/x-www-form-urlencoded'})
+}
+
+
+module.exports = {
+ //绑定微信
+ bindWechat(params){
+ return request.post('/sso/bindWechat',params, {'content-type':'application/x-www-form-urlencoded'})
+ },
+}
\ No newline at end of file