|
@@ -7,7 +7,7 @@
|
|
|
<view class="fb-type">
|
|
|
<view class="type-label">{{array[index]}}</view>
|
|
|
<image class="type-icon"
|
|
|
- src="../../static/images/icon_select.png">
|
|
|
+ src="/static/images/icon_select.png">
|
|
|
</image>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -19,7 +19,7 @@
|
|
|
<view class="fb-type">
|
|
|
<view class="type-label">{{deviceList[index2].name}}</view>
|
|
|
<image class="type-icon"
|
|
|
- src="../../static/images/icon_select.png">
|
|
|
+ src="/static/images/icon_select.png">
|
|
|
</image>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -28,7 +28,7 @@
|
|
|
<view class="picker" style="position: relative;">
|
|
|
<view class="label" v-if="isToday">今日订单</view>
|
|
|
<view class="fb-type">
|
|
|
- <text>{{range[0]}} - {{range[1]}}</text>
|
|
|
+ <text>{{range[0]?range[0]:''}} - {{range[1]?range[1]:''}}</text>
|
|
|
<button type="primary" @click="onShowDatePicker('range')" :disabled="isToday" >选择</button>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -99,7 +99,8 @@
|
|
|
orderCount: 2,
|
|
|
orderSum: 0.0,
|
|
|
array: ['全部', '开门', '关门'],
|
|
|
- orderList: [{
|
|
|
+ orderList: [
|
|
|
+ /*{
|
|
|
name: '美式咖啡',
|
|
|
memberName: '飞起来的虫',
|
|
|
orderSn: 'DD202106010',
|
|
@@ -126,7 +127,8 @@
|
|
|
status: '3',
|
|
|
price: '15.0',
|
|
|
errorMsg: ''
|
|
|
- }],
|
|
|
+ }*/
|
|
|
+ ],
|
|
|
queryParams: util.initQueryParams(),
|
|
|
totalPages: 1,
|
|
|
totalPages2: 1
|
|
@@ -140,14 +142,14 @@
|
|
|
this.index = e.detail.value
|
|
|
},
|
|
|
bindPickerChange2: function(e) {
|
|
|
- this.index2 = e.detail.value
|
|
|
+ this.index2 = e.detail.value;
|
|
|
this.deviceId = this.deviceList[this.index2].id
|
|
|
this.orderList = []
|
|
|
this.queryParams.current = 1
|
|
|
- this.queryParams.model.equId = this.deviceId
|
|
|
+ this.queryParams.model.orderEquId = this.deviceId
|
|
|
let pages = getCurrentPages();
|
|
|
let page = pages[pages.length - 1].$page.fullPath;
|
|
|
- let oType = page.split('type=')[1]
|
|
|
+ let oType = page.split('type=')[1]
|
|
|
this.getOrderList(oType)
|
|
|
},
|
|
|
bindDateChange: function(e) {
|
|
@@ -186,7 +188,7 @@
|
|
|
let oType = page.split('type=')[1]
|
|
|
this.getOrderList(oType)
|
|
|
},
|
|
|
- getDeviceList() {
|
|
|
+ getDeviceList(equId) {
|
|
|
let that = this;
|
|
|
util.request(api.DeviceList, {}, 'post', 'application/json').then(function(res) {
|
|
|
if (res.code === 0) {
|
|
@@ -194,6 +196,12 @@
|
|
|
//that.page = res.data.currentPage + 1
|
|
|
that.totalPages2 = res.pages
|
|
|
that.deviceList = that.deviceList.concat(res.data.records)
|
|
|
+ if(equId){
|
|
|
+ that.deviceId = equId;
|
|
|
+ that.index2 = that.deviceList.findIndex(function(item){
|
|
|
+ return item.id === equId;
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -203,6 +211,8 @@
|
|
|
that.range=[util.getNowDate(0), util.getNowDate(1)];
|
|
|
that.isToday = true
|
|
|
}else{
|
|
|
+ //异常状态位
|
|
|
+ //that.queryParams.model
|
|
|
that.isToday = false
|
|
|
}
|
|
|
if (that.deviceId) {
|
|
@@ -259,18 +269,10 @@
|
|
|
}
|
|
|
this.getOrderList(type)
|
|
|
},
|
|
|
- onLoad: function(option) {
|
|
|
- this.getDeviceList();
|
|
|
- console.log(this.deviceList)
|
|
|
+ onLoad: function(option) {
|
|
|
let type = option.type? option.type : ""
|
|
|
let equId = option.equId? option.equId : ""
|
|
|
- if(equId){
|
|
|
- this.deviceId = equId;
|
|
|
- this.index2 = this.deviceList.findIndex(function(item){
|
|
|
- return item.id === equId;
|
|
|
- });
|
|
|
- console.log(this.index2);
|
|
|
- }
|
|
|
+ this.getDeviceList(equId);
|
|
|
this.getOrderList(type);
|
|
|
}
|
|
|
}
|