补卡默认工地修改
parent
8951dfe254
commit
a27b093d7d
|
@ -130,8 +130,10 @@
|
||||||
this.worksiteList = res.data.list;
|
this.worksiteList = res.data.list;
|
||||||
if(uni.getStorageSync('worksite_id')){
|
if(uni.getStorageSync('worksite_id')){
|
||||||
this.worksiteIndex = this.worksiteList.findIndex(item=> item.id === uni.getStorageSync('worksite_id'));
|
this.worksiteIndex = this.worksiteList.findIndex(item=> item.id === uni.getStorageSync('worksite_id'));
|
||||||
}else{
|
}else if(uni.getStorageSync('baseWorksiteId')!==0){
|
||||||
this.worksiteIndex = this.worksiteList.findIndex(item=> item.id === uni.getStorageSync('baseWorksiteId'));
|
this.worksiteIndex = this.worksiteList.findIndex(item=> item.id === uni.getStorageSync('baseWorksiteId'));
|
||||||
|
}else{
|
||||||
|
this.worksiteIndex = -1;
|
||||||
}
|
}
|
||||||
this.isLoding = true;
|
this.isLoding = true;
|
||||||
}
|
}
|
||||||
|
@ -158,7 +160,7 @@
|
||||||
submitEv(){
|
submitEv(){
|
||||||
let params = {
|
let params = {
|
||||||
day:this.curDate,
|
day:this.curDate,
|
||||||
worksite_id:this.worksiteList[this.worksiteIndex].id,
|
worksite_id:this.worksiteIndex!==-1?this.worksiteList[this.worksiteIndex].id:0,
|
||||||
type:this.radioList[this.radioIndex].type
|
type:this.radioList[this.radioIndex].type
|
||||||
}
|
}
|
||||||
this.$requst.post('/api/v1/user/replenish',params).then(res=>{
|
this.$requst.post('/api/v1/user/replenish',params).then(res=>{
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -277,10 +277,12 @@ var _default = {
|
||||||
_this.worksiteIndex = _this.worksiteList.findIndex(function (item) {
|
_this.worksiteIndex = _this.worksiteList.findIndex(function (item) {
|
||||||
return item.id === uni.getStorageSync('worksite_id');
|
return item.id === uni.getStorageSync('worksite_id');
|
||||||
});
|
});
|
||||||
} else {
|
} else if (uni.getStorageSync('baseWorksiteId') !== 0) {
|
||||||
_this.worksiteIndex = _this.worksiteList.findIndex(function (item) {
|
_this.worksiteIndex = _this.worksiteList.findIndex(function (item) {
|
||||||
return item.id === uni.getStorageSync('baseWorksiteId');
|
return item.id === uni.getStorageSync('baseWorksiteId');
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
_this.worksiteIndex = -1;
|
||||||
}
|
}
|
||||||
_this.isLoding = true;
|
_this.isLoding = true;
|
||||||
}
|
}
|
||||||
|
@ -305,7 +307,7 @@ var _default = {
|
||||||
var _this2 = this;
|
var _this2 = this;
|
||||||
var params = {
|
var params = {
|
||||||
day: this.curDate,
|
day: this.curDate,
|
||||||
worksite_id: this.worksiteList[this.worksiteIndex].id,
|
worksite_id: this.worksiteIndex !== -1 ? this.worksiteList[this.worksiteIndex].id : 0,
|
||||||
type: this.radioList[this.radioIndex].type
|
type: this.radioList[this.radioIndex].type
|
||||||
};
|
};
|
||||||
this.$requst.post('/api/v1/user/replenish', params).then(function (res) {
|
this.$requst.post('/api/v1/user/replenish', params).then(function (res) {
|
||||||
|
|
Loading…
Reference in New Issue