初始化项目
This commit is contained in:
416
Web/pages/index/index.js
Normal file
416
Web/pages/index/index.js
Normal file
@@ -0,0 +1,416 @@
|
||||
// index.js
|
||||
// 获取应用实例
|
||||
const app = getApp()
|
||||
import {
|
||||
Goodid,
|
||||
GetdingdanbyID,
|
||||
GetshpingxxbyS,
|
||||
GetdingdanbyPID
|
||||
} from '../../lib/RequestingCenter.js'
|
||||
const format = require("../../utils/util.js");
|
||||
let SCREEN_WIDTH = 750
|
||||
let RATE = wx.getSystemInfoSync().screenHeight / wx.getSystemInfoSync().screenWidth
|
||||
var Statusssss = 0;
|
||||
var ShippingCodesss = "";
|
||||
var ProjectListIDss = 0;
|
||||
var sqlids = 0;
|
||||
Page({
|
||||
data: {
|
||||
ScreenTotalW: SCREEN_WIDTH,
|
||||
ScreenTotalH: SCREEN_WIDTH * RATE,
|
||||
ScreenH: 220,
|
||||
isCopyingTextDomID: '', //正在拷贝选中字符串,处于蓝底白字
|
||||
//未装箱数量
|
||||
wzxnum: 0,
|
||||
//装箱中数量
|
||||
zxznum: 0,
|
||||
//完成数量
|
||||
wcddnum: 0,
|
||||
//全部数量
|
||||
quanbunum: 0,
|
||||
scanCode: '',
|
||||
scanQuCode: '+',
|
||||
listers: [],
|
||||
lists: [],
|
||||
Dingdanlist: [],
|
||||
//名字搜素
|
||||
name: '',
|
||||
// 查询类型
|
||||
apptype: -1,
|
||||
ProjectList: [],
|
||||
option1: [],
|
||||
//机型
|
||||
value1: 0,
|
||||
//选中机型
|
||||
ProjectListID: 0,
|
||||
//状态
|
||||
Stu: 0,
|
||||
// 订单信息
|
||||
ShippCode: "",
|
||||
// 机型
|
||||
pid: 0
|
||||
},
|
||||
//下拉框选择
|
||||
onConfirm(o) {
|
||||
var that = this;
|
||||
let list = []
|
||||
var names = that.data.name;
|
||||
let status = Number(that.data.apptype) + 1;
|
||||
let pid = o.detail
|
||||
// 机型号码
|
||||
ProjectListIDss = o.detail
|
||||
that.setData({
|
||||
ProjectListID: o.detail
|
||||
})
|
||||
wx.showLoading({
|
||||
title: '请稍后....',
|
||||
});
|
||||
GetdingdanbyPID({
|
||||
ShippingCode: names,
|
||||
Status: status,
|
||||
ProjectListID: pid,
|
||||
sqlid: sqlids
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
res.Data.userinfo.forEach((x) => {
|
||||
list.push(x.ShippingCode);
|
||||
x.projectNameInfo = res.Data.ProjectList.filter(y => y.ID == x.ProjectID)[0].ProjectName;
|
||||
})
|
||||
if (res.Status == 200) {
|
||||
that.setData({
|
||||
listers: res.Data.userinfo,
|
||||
ProjectList: res.Data.ProjectList
|
||||
});
|
||||
wx.hideLoading();
|
||||
} else {
|
||||
app.toast(2, res.Message || "网络繁忙")
|
||||
}
|
||||
}, err => {
|
||||
app.toast(2, "网络繁忙")
|
||||
}).catch(
|
||||
err => {
|
||||
console.log(err)
|
||||
app.toast("异常", 'error')
|
||||
}
|
||||
);
|
||||
},
|
||||
onLoad(e) {
|
||||
var that = this
|
||||
sqlids = e.Sqlid;
|
||||
console.log(sqlids)
|
||||
wx.hideLoading();
|
||||
wx.showLoading({
|
||||
title: '请稍后....',
|
||||
});
|
||||
Goodid({
|
||||
Status: Statusssss,
|
||||
ShippingCode: ShippingCodesss,
|
||||
ProjectListID: ProjectListIDss,
|
||||
sqlid: sqlids
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.Status == 200) {
|
||||
let list = []
|
||||
list.push("全部订单")
|
||||
let plist = []
|
||||
let pname = {
|
||||
value: 0,
|
||||
text: '全部机型'
|
||||
};
|
||||
plist.push(pname);
|
||||
res.Data.TBL_Projectytpe.forEach((x) => {
|
||||
plist.push(x)
|
||||
})
|
||||
res.Data.userinfo.forEach((x) => {
|
||||
x.projectNameInfo = res.Data.ProjectList.filter(y => y.ID == x.ProjectID)[0].ProjectName;
|
||||
})
|
||||
that.setData({
|
||||
listers: res.Data.userinfo,
|
||||
lists: list,
|
||||
Dingdanlist: res.Data.userinfo,
|
||||
ProjectList: res.Data.ProjectList,
|
||||
//未装箱数量
|
||||
wzxnum: res.wzx,
|
||||
//装箱中数量
|
||||
zxznum: res.zxz,
|
||||
//完成数量
|
||||
wcddnum: res.shuliabn,
|
||||
//全部数量
|
||||
quanbunum: res.quabu,
|
||||
option1: plist,
|
||||
value1: 0,
|
||||
apptype: -1,
|
||||
});
|
||||
// console.log(that.data.option1)
|
||||
} else if (res.Status == 100) {
|
||||
app.toast(2, "你的帐号已经被管理员禁用了,请联系管理员")
|
||||
} else {
|
||||
app.toast(2, res.Message || "网络繁忙")
|
||||
}
|
||||
wx.hideLoading();
|
||||
}, err => {
|
||||
app.toast(2, "网络繁忙")
|
||||
}).catch(
|
||||
err => {
|
||||
console.log(err)
|
||||
app.toast("异常", 'error')
|
||||
}
|
||||
);
|
||||
|
||||
},
|
||||
//出货单绑定
|
||||
// bindPickerChange: function (e) {
|
||||
// var that = this;
|
||||
// this.setData({
|
||||
// index: e.detail.value,
|
||||
// })
|
||||
// var curIdex = e.detail.value - 1;
|
||||
// console.log(curIdex)
|
||||
// var xx = "";
|
||||
// if (curIdex == -1) {
|
||||
// xx = "0";
|
||||
// } else {
|
||||
// xx = that.data.Dingdanlist[curIdex].ShippingCode;
|
||||
// // console.log(xx)
|
||||
// }
|
||||
// GetdingdanbyID({
|
||||
// ShippingCode: xx
|
||||
// }).then(res => {
|
||||
// if (res.Status == 200) {
|
||||
// that.setData({
|
||||
// listers: res.Data.userinfo,
|
||||
// });
|
||||
// } else {
|
||||
// app.toast(2, res.Message || "网络繁忙")
|
||||
// }
|
||||
// }, err => {
|
||||
// app.toast(2, "网络繁忙")
|
||||
// }).catch(
|
||||
// err => {
|
||||
// console.log(err)
|
||||
// app.toast("异常", 'error')
|
||||
// }
|
||||
// );
|
||||
// },
|
||||
onShow: function () {
|
||||
var that = this
|
||||
wx.hideLoading();
|
||||
wx.showLoading({
|
||||
title: '请稍后....',
|
||||
});
|
||||
if (sqlids == 1) {
|
||||
that.setData({
|
||||
DBname: "uts_zongqing"
|
||||
})
|
||||
} else {
|
||||
that.setData({
|
||||
DBname: "uts_johao"
|
||||
})
|
||||
}
|
||||
GetshpingxxbyS({
|
||||
Status: Statusssss,
|
||||
ShippingCode: ShippingCodesss,
|
||||
ProjectListID: ProjectListIDss,
|
||||
sqlid: sqlids
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
res.Data.userinfo.forEach((x) => {
|
||||
x.projectNameInfo = res.Data.ProjectList.filter(y => y.ID == x.ProjectID)[0].ProjectName;
|
||||
})
|
||||
if (res.Status == 200) {
|
||||
// console.log(res)
|
||||
that.setData({
|
||||
listers: res.Data.userinfo,
|
||||
ProjectList: res.Data.ProjectList,
|
||||
//未装箱数量
|
||||
wzxnum: res.wzx,
|
||||
//装箱中数量
|
||||
zxznum: res.zxz,
|
||||
//完成数量
|
||||
wcddnum: res.shuliabn,
|
||||
//全部数量
|
||||
quanbunum: res.quabu,
|
||||
// apptype: -1,
|
||||
});
|
||||
wx.hideLoading();
|
||||
} else {
|
||||
app.toast(2, res.Message || "网络繁忙")
|
||||
}
|
||||
}, err => {
|
||||
app.toast(2, "网络繁忙")
|
||||
}).catch(
|
||||
err => {
|
||||
console.log(err)
|
||||
app.toast("异常", 'error')
|
||||
}
|
||||
);
|
||||
},
|
||||
//页面跳转
|
||||
DianJiDingDan: function (e) {
|
||||
var xx = this.data.listers.find(ee => {
|
||||
return ee.ShippingCode == e.currentTarget.id
|
||||
})
|
||||
if (xx.Status == 3) {
|
||||
//物品信息页面
|
||||
wx.navigateTo({
|
||||
url: '/pages/autho/index?ShippingCode=' + e.currentTarget.id + '&sqlid=' + sqlids
|
||||
})
|
||||
} else {
|
||||
//物品信息页面
|
||||
wx.navigateTo({
|
||||
url: '/pages/OUtBoxBarCode/OUtBoxBarCode?ShippingCode=' + e.currentTarget.id + '&sqlid=' + sqlids
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
//用户输入订单号码查询
|
||||
sreach: function () {
|
||||
var that = this;
|
||||
let list = []
|
||||
var names = that.data.name;
|
||||
wx.hideLoading();
|
||||
wx.showLoading({
|
||||
title: '请稍后....',
|
||||
});
|
||||
// 订单号码
|
||||
ShippingCodesss = that.data.name
|
||||
let status = Number(that.data.apptype) + 1;
|
||||
let pid = that.data.ProjectListID
|
||||
GetdingdanbyID({
|
||||
ShippingCode: names,
|
||||
Status: status,
|
||||
ProjectListID: pid,
|
||||
sqlid: sqlids
|
||||
}).then(res => {
|
||||
// console.log(res)
|
||||
res.Data.userinfo.forEach((x) => {
|
||||
list.push(x.ShippingCode);
|
||||
x.projectNameInfo = res.Data.ProjectList.filter(y => y.ID == x.ProjectID)[0].ProjectName;
|
||||
})
|
||||
if (res.Status == 200) {
|
||||
that.setData({
|
||||
listers: res.Data.userinfo,
|
||||
ProjectList: res.Data.ProjectList
|
||||
});
|
||||
} else {
|
||||
app.toast(2, res.Message || "网络繁忙")
|
||||
}
|
||||
wx.hideLoading();
|
||||
}, err => {
|
||||
app.toast(2, "网络繁忙")
|
||||
}).catch(
|
||||
err => {
|
||||
console.log(err)
|
||||
app.toast("异常", 'error')
|
||||
}
|
||||
);
|
||||
},
|
||||
//状态查询
|
||||
selapptype: function (e) {
|
||||
var that = this;
|
||||
let sel = Number(e.target.dataset.val);
|
||||
let list = []
|
||||
this.setData({
|
||||
apptype: e.target.dataset.val,
|
||||
})
|
||||
wx.hideLoading();
|
||||
wx.showLoading({
|
||||
title: '请稍后....',
|
||||
});
|
||||
var Stu = sel + 1;
|
||||
// 状态号码
|
||||
Statusssss = Stu;
|
||||
var ShippCode = that.data.name
|
||||
let pid = that.data.ProjectListID
|
||||
GetshpingxxbyS({
|
||||
Status: Stu,
|
||||
ShippingCode: ShippCode,
|
||||
ProjectListID: pid,
|
||||
sqlid: sqlids
|
||||
}).then(res => {
|
||||
res.Data.userinfo.forEach((x) => {
|
||||
list.push(x.ShippingCode);
|
||||
x.projectNameInfo = res.Data.ProjectList.filter(y => y.ID == x.ProjectID)[0].ProjectName;
|
||||
})
|
||||
if (res.Status == 200) {
|
||||
that.setData({
|
||||
listers: res.Data.userinfo,
|
||||
ProjectList: res.Data.ProjectList
|
||||
});
|
||||
} else {
|
||||
app.toast(2, res.Message || "网络繁忙")
|
||||
}
|
||||
wx.hideLoading();
|
||||
}, err => {
|
||||
app.toast(2, "网络繁忙")
|
||||
}).catch(
|
||||
err => {
|
||||
console.log(err)
|
||||
app.toast("异常", 'error')
|
||||
}
|
||||
);
|
||||
console.log(Statusssss)
|
||||
},
|
||||
getProjectName: function (proID) {
|
||||
console.log("goes here.")
|
||||
var retList = this.data.ProjectList.filter(x => x.ID == proID);
|
||||
if (retList.length > 0)
|
||||
return retList[0].ProjectName;
|
||||
return "";
|
||||
},
|
||||
onUnload: function () {
|
||||
var that = this;
|
||||
|
||||
},
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
//长按复制
|
||||
copyText: function (e) {
|
||||
console.log(e)
|
||||
var that = this;
|
||||
var strID = e.currentTarget.id;
|
||||
var arrSplit = strID.split("_");
|
||||
const text = arrSplit[1];
|
||||
|
||||
that.setData({
|
||||
isCopyingTextDomID: strID
|
||||
});
|
||||
|
||||
wx.setClipboardData({
|
||||
data: text,
|
||||
success: function () {
|
||||
wx.showToast({
|
||||
title: '复制成功'
|
||||
});
|
||||
|
||||
//已经copy成功,但是依然显示蓝底白字状态1秒钟,然后提示用户拷贝成功,取消蓝底白字状态。
|
||||
setTimeout(function () {
|
||||
that.setData({
|
||||
isCopyingTextDomID: ''
|
||||
});
|
||||
}, 3000);
|
||||
|
||||
},
|
||||
fail: function () {
|
||||
var that = this;
|
||||
that.setData({
|
||||
isCopyingText: false
|
||||
});
|
||||
wx.showToast({
|
||||
title: '复制失败',
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
showSuccessCopyProc: function () {
|
||||
var that = this;
|
||||
|
||||
}
|
||||
})
|
||||
5
Web/pages/index/index.json
Normal file
5
Web/pages/index/index.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
|
||||
}
|
||||
}
|
||||
86
Web/pages/index/index.wxml
Normal file
86
Web/pages/index/index.wxml
Normal file
@@ -0,0 +1,86 @@
|
||||
<!--index.wxml-->
|
||||
<wxs module="filter" src="../../utils/filters.wxs"></wxs>
|
||||
<cu-custom bgColor="bg-gradual-blue">
|
||||
<view slot="content">AUTS数据中心-出货装车</view>
|
||||
<view slot="contents"> {{DBname}} </view>
|
||||
</cu-custom>
|
||||
<view class="padding-sm bg-white radius shadow shadow-lg" style="width: {{ScreenTotalW}}rpx;height:{{ScreenTotalH}}rxp;">
|
||||
<!-- 条件查询开始 -->
|
||||
<view style="height: {{ScreenH}}rpx; width: {{ScreenTotalW}}rpx;">
|
||||
<view style="flex-basis:100% " class="flex padding-top-xs">
|
||||
<view>
|
||||
<van-button type="default" bindtap="selapptype" data-val="-1" color="{{apptype==-1?'#20a860':''}}"> <span>全部({{quanbunum}})</span></van-button>
|
||||
</view>
|
||||
<view bindtap="selapptype" style="margin-left: 1px;">
|
||||
<van-button type="default" bindtap="selapptype" data-val="0" color="{{apptype==0?'#e65f50':''}}"> <span>未装车({{wzxnum}})</span></van-button>
|
||||
</view>
|
||||
<view style="margin-left: 1px;">
|
||||
<van-button type="default" style="margin-left: 1px;" bindtap="selapptype" data-val="1" color="{{apptype==1?'#f8ce53':''}}"> <span>装车中({{zxznum}})</span></van-button>
|
||||
</view>
|
||||
<view style="margin-left: 3px;">
|
||||
<van-button type="default" bindtap="selapptype" data-val="2" color="{{apptype==2?'#20a860':''}}"> <span>已结单({{wcddnum}})</span></van-button>
|
||||
</view>
|
||||
</view>
|
||||
<view style="flex-basis:100%; font-size: 10px;" class="flex padding-top-xs align-center">
|
||||
<van-dropdown-menu>
|
||||
<van-dropdown-item value="{{ value1 }}" options="{{ option1 }}" bind:change="onConfirm" />
|
||||
</van-dropdown-menu>
|
||||
<input type="number" style="border-bottom: 2rpx solid #ccc !important; margin-left: 20px; margin-top: 20px;" class="text-df" placeholder="搜索订单" name="input" model:value="{{name}}"></input>
|
||||
<button bindtap="sreach" class="cuIcon-search" style="height: 30px; width: 80px;background-color: #20a860;"></button>
|
||||
</view>
|
||||
<!-- 条件查询结束 -->
|
||||
</view>
|
||||
<!-- 内容区域开始 -->
|
||||
<!-- 内容区开始 -->
|
||||
<scroll-view class="scroll-view_H .solids-right .solids-left" scroll-y="true" style="height:{{ScreenTotalH-ScreenH-300}}rpx;">
|
||||
<block wx:for="{{listers}}" wx:key="this">
|
||||
<view id="{{item.ShippingCode}}" bindtap="DianJiDingDan">
|
||||
<view class="weathers_imet_lists .light .solids-top .solids-left .shadow-blur ">
|
||||
<view style="font-weight: 550;" selectable="true" id="shiplistitem_{{item.ShippingCode}}" bind:longpress="copyText">
|
||||
<block wx:if="{{isCopyingTextDomID==('shiplistitem_' + item.ShippingCode)}}">
|
||||
<span class="long-press-selecting">{{item.ShippingCode}}</span>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<span style="color: #7f6000;">{{filter.SubString(item.ShippingCode,0,2)}}</span>
|
||||
<span style="color: #2e75b6">{{filter.SubString(item.ShippingCode,2,6)}}</span>
|
||||
<span style="color: #7f6000;">{{filter.SubString(item.ShippingCode,6,10)}}</span>
|
||||
<span style="color: #2e75b6">{{filter.SubString(item.ShippingCode,10,14)}}</span>
|
||||
<span style="color: #7f6000;">{{filter.SubString(item.ShippingCode,14)}}</span>
|
||||
</block>
|
||||
</view>
|
||||
<view>
|
||||
<span class="cuIcon-countdown .text-gray">
|
||||
{{filter.TimeFormat(item.CreateDateTime)}}
|
||||
</span>
|
||||
</view>
|
||||
<view>
|
||||
<span class="cuIcon-rankfill">
|
||||
{{item.QTY}}/已装:{{item.BindedColorBoxQTY}}</span>
|
||||
</view>
|
||||
<view>
|
||||
<span class=".cuIcon-post text-cut" style="display: inline-block; width: 200px;">
|
||||
{{item.Remark}}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weathers_imet_list .light .solids-top .solids-right .shadow-blur">
|
||||
<view class="text-cut .text-blue" style="font-weight: 900;">
|
||||
<span class="text-df">{{item.projectNameInfo}}</span>
|
||||
</view>
|
||||
<view>
|
||||
<span class=".cuIcon-new">
|
||||
<span class=" {{(item.Status === 1 ? '.text-red ' : (item.Status===2?'.text-yellow ':'.text-green'))}}">
|
||||
{{(item.Status === 1 ? '未装车' : (item.Status === 2 ? "装车中" : "已结单"))}}
|
||||
</span>
|
||||
</span>
|
||||
<view>
|
||||
<span class=" .cuIcon-location text-cut" style="display: inline-block; width: 100px;">
|
||||
{{item.Destination}}
|
||||
</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
<!-- 内容区结束 -->
|
||||
</view>
|
||||
83
Web/pages/index/index.wxss
Normal file
83
Web/pages/index/index.wxss
Normal file
@@ -0,0 +1,83 @@
|
||||
/**index.wxss**/
|
||||
.foot {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-top: 65px;
|
||||
}
|
||||
|
||||
.weathers_imet {
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.custom-class {
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.van-ellipsis {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.bgss-green {
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
.weathers_imet_lists {
|
||||
float: left;
|
||||
width: 65%;
|
||||
height: 10%;
|
||||
padding-left: 10px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.weathers_imet_list {
|
||||
float: left;
|
||||
width: 35%;
|
||||
height: 10%;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.heade {
|
||||
position: fixed;
|
||||
top: 60px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.green-text {
|
||||
color: white;
|
||||
display: inline-block;
|
||||
background-color: green;
|
||||
width: 150rpx;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
/* border-radius: 10%; */
|
||||
}
|
||||
|
||||
.red-text {
|
||||
color: white;
|
||||
display: inline-block;
|
||||
width: 150rpx;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
.yellow-text {
|
||||
color: white;
|
||||
display: inline-block;
|
||||
background-color: yellow;
|
||||
width: 150rpx;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.shiping_time {
|
||||
font-weight: 900;
|
||||
font-size: 10px;
|
||||
}
|
||||
Reference in New Issue
Block a user