...
|
...
|
@@ -10,11 +10,61 @@ Page({ |
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
montharr: [{
|
|
|
sel: false,
|
|
|
name: '1月'
|
|
|
},
|
|
|
{
|
|
|
sel: false,
|
|
|
name: '2月'
|
|
|
},
|
|
|
{
|
|
|
sel: false,
|
|
|
name: '3月'
|
|
|
},
|
|
|
{
|
|
|
sel: false,
|
|
|
name: '4月'
|
|
|
},
|
|
|
{
|
|
|
sel: false,
|
|
|
name: '5月'
|
|
|
},
|
|
|
{
|
|
|
sel: false,
|
|
|
name: '6月'
|
|
|
},
|
|
|
{
|
|
|
sel: false,
|
|
|
name: '7月'
|
|
|
},
|
|
|
{
|
|
|
sel: false,
|
|
|
name: '8月'
|
|
|
},
|
|
|
{
|
|
|
sel: false,
|
|
|
name: '9月'
|
|
|
},
|
|
|
{
|
|
|
sel: false,
|
|
|
name: '10月'
|
|
|
},
|
|
|
{
|
|
|
sel: false,
|
|
|
name: '11月'
|
|
|
},
|
|
|
{
|
|
|
sel: false,
|
|
|
name: '12月'
|
|
|
},
|
|
|
],
|
|
|
showModal: false,
|
|
|
showt: true,
|
|
|
modalTitle: ["选择时间", "选择地磅", "选择货物"],
|
|
|
modalNum: 0,
|
|
|
monthList: ["货物名字", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘炒股的人格", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", "车间后方大转盘", ],
|
|
|
time: '2019.01.01-2019.01.31',
|
|
|
time: '近30天',
|
|
|
changeColor: 0,
|
|
|
tabList: ["出库", "流水"],
|
|
|
tabNum: 0,
|
...
|
...
|
@@ -42,16 +92,20 @@ Page({ |
|
|
},
|
|
|
],
|
|
|
|
|
|
watertime:'',
|
|
|
watertime: '',
|
|
|
|
|
|
|
|
|
//出库日期
|
|
|
statedate: '',
|
|
|
|
|
|
timestate:1,
|
|
|
timesel:1,
|
|
|
timestate: 1,
|
|
|
timesel: 1,
|
|
|
startdate: '',
|
|
|
enddate: '',
|
|
|
yeararray: [],
|
|
|
yearname: '',
|
|
|
|
|
|
|
|
|
ec: {
|
|
|
|
|
|
onInit: function(canvas, width, height) {
|
...
|
...
|
@@ -71,7 +125,9 @@ Page({ |
|
|
},
|
|
|
|
|
|
lazyLoad: true, // 延迟加载
|
|
|
showt: false
|
|
|
|
|
|
shodate: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
...
|
...
|
@@ -79,7 +135,9 @@ Page({ |
|
|
this.setData({
|
|
|
tabNum: e.currentTarget.dataset.id
|
|
|
})
|
|
|
if(this.data.tabNum==0){
|
|
|
|
|
|
console.log(this.data.tabNum)
|
|
|
if (this.data.tabNum == 0) {
|
|
|
|
|
|
this.echartsComponnet = this.selectComponent('#mychart');
|
|
|
|
...
|
...
|
@@ -125,10 +183,10 @@ Page({ |
|
|
day = "0" + day
|
|
|
}
|
|
|
console.log()
|
|
|
if (typeof (day) == 'number') {
|
|
|
if (typeof(day) == 'number') {
|
|
|
day = day.toString()
|
|
|
}
|
|
|
console.log(typeof (day))
|
|
|
console.log(typeof(day))
|
|
|
this.setData({
|
|
|
datePickerValue: [year, month, day],
|
|
|
})
|
...
|
...
|
@@ -137,9 +195,9 @@ Page({ |
|
|
|
|
|
// 时间地磅货物选择
|
|
|
|
|
|
selectbang(e){
|
|
|
selectbang(e) {
|
|
|
this.setData({
|
|
|
modalNum:e.currentTarget.dataset.index
|
|
|
modalNum: e.currentTarget.dataset.index
|
|
|
})
|
|
|
},
|
|
|
|
...
|
...
|
@@ -155,7 +213,7 @@ Page({ |
|
|
|
|
|
this.datexianshi()
|
|
|
},
|
|
|
datePickerOnSureClick: function (e) {
|
|
|
datePickerOnSureClick: function(e) {
|
|
|
console.log('datePickerOnSureClick');
|
|
|
|
|
|
if (this.data.timesel == 1) {
|
...
|
...
|
@@ -182,7 +240,7 @@ Page({ |
|
|
|
|
|
},
|
|
|
|
|
|
datePickerOnCancelClick: function (event) {
|
|
|
datePickerOnCancelClick: function(event) {
|
|
|
console.log('datePickerOnCancelClick');
|
|
|
console.log(event);
|
|
|
this.setData({
|
...
|
...
|
@@ -201,21 +259,21 @@ Page({ |
|
|
})
|
|
|
},
|
|
|
|
|
|
// 选择地磅
|
|
|
quedibang(){
|
|
|
// 选择地磅
|
|
|
quedibang() {
|
|
|
this.setData({
|
|
|
datechu: false
|
|
|
})
|
|
|
},
|
|
|
// 取消选择
|
|
|
quxiaobang(){
|
|
|
quxiaobang() {
|
|
|
this.setData({
|
|
|
datechu: false,
|
|
|
watertime: app.newnowDate() + '-' + app.endate(),
|
|
|
})
|
|
|
},
|
|
|
choice(e) {
|
|
|
let index = e.currentTarget.dataset.id
|
|
|
let index = e.currentTarget.dataset.id;
|
|
|
|
|
|
this.setData({
|
|
|
changeColor: e.currentTarget.dataset.id,
|
...
|
...
|
@@ -223,6 +281,111 @@ Page({ |
|
|
|
|
|
})
|
|
|
},
|
|
|
//年份选择
|
|
|
bindyearChange(e) {
|
|
|
console.log(e)
|
|
|
this.setData({
|
|
|
|
|
|
yearname: this.data.yeararray[e.detail.value]
|
|
|
})
|
|
|
|
|
|
this.chosemonth()
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
choicemonth(e) {
|
|
|
let index = e.currentTarget.dataset.id;
|
|
|
this.setData({
|
|
|
showt: false,
|
|
|
monthindex: index
|
|
|
})
|
|
|
|
|
|
|
|
|
let newmonthList = this.data.montharr;
|
|
|
for (var i = 0; i < newmonthList.length; i++) {
|
|
|
|
|
|
if (i == index) {
|
|
|
|
|
|
console.log(3489894)
|
|
|
newmonthList[index].sel = !newmonthList[index].sel;
|
|
|
} else {
|
|
|
|
|
|
newmonthList[i].sel = false
|
|
|
}
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
montharr: newmonthList
|
|
|
})
|
|
|
|
|
|
|
|
|
this.chosemonth()
|
|
|
|
|
|
console.log(this.data.time)
|
|
|
},
|
|
|
|
|
|
|
|
|
//选择月份
|
|
|
chosemonth() {
|
|
|
let index = this.data.monthindex;
|
|
|
index = index + 1
|
|
|
if (index == 1 || index == 3 || index == 5 || index == 7 || index == 8 || index == 10 || index == 12) {
|
|
|
if (index < 10) {
|
|
|
this.setData({
|
|
|
time: this.data.yearname + "." + "0" + index + ".01" + "-" + this.data.yearname + "." + '0' + index + ".31"
|
|
|
})
|
|
|
} else {
|
|
|
this.setData({
|
|
|
time: this.data.yearname + "." + index + ".01" + '-' + this.data.yearname + "." + index + ".31"
|
|
|
})
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
if (index < 10) {
|
|
|
this.setData({
|
|
|
time: +this.data.yearname + "." + "0" + index + ".01" + "-" + this.data.yearname + "." + '0' + index + ".30"
|
|
|
})
|
|
|
} else {
|
|
|
this.setData({
|
|
|
time: +this.data.yearname + "." + index + ".01" + "-" + this.data.yearname + "." + index + ".30"
|
|
|
})
|
|
|
}
|
|
|
|
|
|
}
|
|
|
},
|
|
|
three() {
|
|
|
|
|
|
let newmonthList = this.data.montharr;
|
|
|
for (var obj of newmonthList) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
this.setData({
|
|
|
time: '近30天',
|
|
|
montharr: newmonthList,
|
|
|
showt: !this.data.showt
|
|
|
})
|
|
|
},
|
|
|
|
|
|
hideModal() {
|
|
|
this.setData({
|
|
|
showModal: false
|
|
|
});
|
|
|
this.echartsComponnet = this.selectComponent('#mychart');
|
|
|
|
|
|
|
|
|
//如果是第一次绘制
|
|
|
|
|
|
if (!Chart) {
|
|
|
this.init_echarts(); //初始化图表
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.setOption(Chart); //更新数据
|
|
|
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
...
|
...
|
@@ -231,19 +394,34 @@ Page({ |
|
|
this.setData({
|
|
|
statedate: app.monthnowDate(),
|
|
|
startdate: app.newnowDate(),
|
|
|
enddate: app.endate()
|
|
|
enddate: app.endate(),
|
|
|
watertime: app.newnowDate() + '-' + app.endate(),
|
|
|
})
|
|
|
let newdate = this.data.statedate.split("-");
|
|
|
|
|
|
|
|
|
|
|
|
//获取年份数组
|
|
|
var newdate = new Date();
|
|
|
var newyear = newdate.getFullYear();
|
|
|
let newyeararray = this.data.yeararray;
|
|
|
console.log(typeof(newyear))
|
|
|
|
|
|
|
|
|
for (var i = 1990; i <= newyear; i++) {
|
|
|
newyeararray.push(i)
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
showdate: newdate[0] + '年' + newdate[1] + '月',
|
|
|
watertime: app.newnowDate() + '-' + app.endate(),
|
|
|
yeararray: newyeararray,
|
|
|
yearname: newyear
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
// 跳转详情页
|
|
|
detail(){
|
|
|
detail() {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/companybox/zhishudetail/chengpindetail/chengpindetail',
|
|
|
})
|
...
|
...
|
|