|
@@ -136,6 +136,7 @@ export class UserData {
|
|
role: 'cancel',
|
|
role: 'cancel',
|
|
cssClass: 'secondary',
|
|
cssClass: 'secondary',
|
|
handler: () => {
|
|
handler: () => {
|
|
|
|
+ this.clear()
|
|
this.router.navigateByUrl('/login');
|
|
this.router.navigateByUrl('/login');
|
|
return this.storage.remove(this.HAS_LOGGED_IN).then(async () => {
|
|
return this.storage.remove(this.HAS_LOGGED_IN).then(async () => {
|
|
}).then(() => {
|
|
}).then(() => {
|
|
@@ -148,7 +149,6 @@ export class UserData {
|
|
]
|
|
]
|
|
});
|
|
});
|
|
await alert.present();
|
|
await alert.present();
|
|
- return this.storage.clear();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// 开单号扫描
|
|
// 开单号扫描
|
|
@@ -589,7 +589,7 @@ export class UserData {
|
|
}
|
|
}
|
|
|
|
|
|
// 获取入库单列表
|
|
// 获取入库单列表
|
|
- async geteEnterStoreList(code:string,size:number): Promise<any> {
|
|
|
|
|
|
+ async geteEnterStoreList(code: string, size: number): Promise<any> {
|
|
const token = await this.getToken();
|
|
const token = await this.getToken();
|
|
const loading = await this.loadingCtrl.create();
|
|
const loading = await this.loadingCtrl.create();
|
|
await loading.present();
|
|
await loading.present();
|
|
@@ -600,7 +600,7 @@ export class UserData {
|
|
headers)).pipe(
|
|
headers)).pipe(
|
|
finalize(() => loading.dismiss())
|
|
finalize(() => loading.dismiss())
|
|
).subscribe(async data => {
|
|
).subscribe(async data => {
|
|
- if (JSON.parse(data.data).code===1) {
|
|
|
|
|
|
+ if (JSON.parse(data.data).code === 1) {
|
|
const toast = await this.toastCtrl.create({
|
|
const toast = await this.toastCtrl.create({
|
|
message: JSON.parse(data.data).msg,
|
|
message: JSON.parse(data.data).msg,
|
|
duration: 1000,
|
|
duration: 1000,
|
|
@@ -622,39 +622,39 @@ export class UserData {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- // 获取入库单详情
|
|
|
|
- async geteEnterStoreDetail(entergoodsid:string): Promise<any> {
|
|
|
|
- const token = await this.getToken();
|
|
|
|
- const loading = await this.loadingCtrl.create();
|
|
|
|
- await loading.present();
|
|
|
|
- this.nativeHttp.setDataSerializer('json');
|
|
|
|
- const headers = { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json;charset=UTF-8' };
|
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
- from(this.nativeHttp.get(`${environment.APP_SERVE_URL}/inventory/enterStore/mobile/${entergoodsid}`, {},
|
|
|
|
- headers)).pipe(
|
|
|
|
- finalize(() => loading.dismiss())
|
|
|
|
- ).subscribe(async data => {
|
|
|
|
- if (JSON.parse(data.data).code===1) {
|
|
|
|
- const toast = await this.toastCtrl.create({
|
|
|
|
- message: JSON.parse(data.data).msg,
|
|
|
|
- duration: 1000,
|
|
|
|
- position: 'top'
|
|
|
|
- });
|
|
|
|
- await toast.present();
|
|
|
|
- resolve([]);
|
|
|
|
- }
|
|
|
|
- resolve(JSON.parse(data.data));
|
|
|
|
- }, async err => {
|
|
|
|
- console.log(err);
|
|
|
|
|
|
+ // 获取入库单详情
|
|
|
|
+ async geteEnterStoreDetail(entergoodsid: string): Promise<any> {
|
|
|
|
+ const token = await this.getToken();
|
|
|
|
+ const loading = await this.loadingCtrl.create();
|
|
|
|
+ await loading.present();
|
|
|
|
+ this.nativeHttp.setDataSerializer('json');
|
|
|
|
+ const headers = { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json;charset=UTF-8' };
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ from(this.nativeHttp.get(`${environment.APP_SERVE_URL}/inventory/enterStore/mobile/${entergoodsid}`, {},
|
|
|
|
+ headers)).pipe(
|
|
|
|
+ finalize(() => loading.dismiss())
|
|
|
|
+ ).subscribe(async data => {
|
|
|
|
+ if (JSON.parse(data.data).code === 1) {
|
|
const toast = await this.toastCtrl.create({
|
|
const toast = await this.toastCtrl.create({
|
|
- message: '获取失败',
|
|
|
|
|
|
+ message: JSON.parse(data.data).msg,
|
|
duration: 1000,
|
|
duration: 1000,
|
|
position: 'top'
|
|
position: 'top'
|
|
});
|
|
});
|
|
await toast.present();
|
|
await toast.present();
|
|
|
|
+ resolve([]);
|
|
|
|
+ }
|
|
|
|
+ resolve(JSON.parse(data.data));
|
|
|
|
+ }, async err => {
|
|
|
|
+ console.log(err);
|
|
|
|
+ const toast = await this.toastCtrl.create({
|
|
|
|
+ message: '获取失败',
|
|
|
|
+ duration: 1000,
|
|
|
|
+ position: 'top'
|
|
});
|
|
});
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ await toast.present();
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
// 获取入库详情
|
|
// 获取入库详情
|
|
async getStoreDetail(sscId: number, pId: number): Promise<any> {
|
|
async getStoreDetail(sscId: number, pId: number): Promise<any> {
|
|
@@ -1057,39 +1057,39 @@ export class UserData {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- // 查询样品
|
|
|
|
- async getStoreSampleByCode(code: string): Promise<any> {
|
|
|
|
- const token = await this.getToken();
|
|
|
|
- const loading = await this.loadingCtrl.create();
|
|
|
|
- await loading.present();
|
|
|
|
- this.nativeHttp.setDataSerializer('json');
|
|
|
|
- const headers = { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json;charset=UTF-8' };
|
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
- from(this.nativeHttp.get(`${environment.APP_SERVE_URL}/inventory/shelf/mobile/code`, {code:code},
|
|
|
|
- headers)).pipe(
|
|
|
|
- finalize(() => loading.dismiss())
|
|
|
|
- ).subscribe(async data => {
|
|
|
|
- if (JSON.parse(data.data).code == 1) {
|
|
|
|
- const toast = await this.toastCtrl.create({
|
|
|
|
- message: JSON.parse(data.data).msg,
|
|
|
|
- duration: 1000,
|
|
|
|
- position: 'top'
|
|
|
|
- });
|
|
|
|
- await toast.present();
|
|
|
|
- resolve([]);
|
|
|
|
- }
|
|
|
|
- resolve(JSON.parse(data.data));
|
|
|
|
- }, async err => {
|
|
|
|
- console.log(err);
|
|
|
|
|
|
+ // 查询样品
|
|
|
|
+ async getStoreSampleByCode(code: string): Promise<any> {
|
|
|
|
+ const token = await this.getToken();
|
|
|
|
+ const loading = await this.loadingCtrl.create();
|
|
|
|
+ await loading.present();
|
|
|
|
+ this.nativeHttp.setDataSerializer('json');
|
|
|
|
+ const headers = { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json;charset=UTF-8' };
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ from(this.nativeHttp.get(`${environment.APP_SERVE_URL}/inventory/shelf/mobile/code`, { code: code },
|
|
|
|
+ headers)).pipe(
|
|
|
|
+ finalize(() => loading.dismiss())
|
|
|
|
+ ).subscribe(async data => {
|
|
|
|
+ if (JSON.parse(data.data).code == 1) {
|
|
const toast = await this.toastCtrl.create({
|
|
const toast = await this.toastCtrl.create({
|
|
- message: '查询失败',
|
|
|
|
|
|
+ message: JSON.parse(data.data).msg,
|
|
duration: 1000,
|
|
duration: 1000,
|
|
position: 'top'
|
|
position: 'top'
|
|
});
|
|
});
|
|
await toast.present();
|
|
await toast.present();
|
|
|
|
+ resolve([]);
|
|
|
|
+ }
|
|
|
|
+ resolve(JSON.parse(data.data));
|
|
|
|
+ }, async err => {
|
|
|
|
+ console.log(err);
|
|
|
|
+ const toast = await this.toastCtrl.create({
|
|
|
|
+ message: '查询失败',
|
|
|
|
+ duration: 1000,
|
|
|
|
+ position: 'top'
|
|
});
|
|
});
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ await toast.present();
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
// 获取待备货列表
|
|
// 获取待备货列表
|
|
async getWarehouseManagePendingList(current: number, size: number): Promise<any> {
|
|
async getWarehouseManagePendingList(current: number, size: number): Promise<any> {
|
|
@@ -1421,6 +1421,15 @@ export class UserData {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ clear(): Promise<any> {
|
|
|
|
+ return this.storage.get('loginInfo').then((value) => {
|
|
|
|
+ let loginName = value.loginName
|
|
|
|
+ let password = value.password
|
|
|
|
+ this.storage.clear()
|
|
|
|
+ this.storage.set('loginInfo', { loginName: loginName, password: password })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
isLoggedIn(): Promise<boolean> {
|
|
isLoggedIn(): Promise<boolean> {
|
|
return this.storage.get(this.HAS_LOGGED_IN).then((value) => {
|
|
return this.storage.get(this.HAS_LOGGED_IN).then((value) => {
|
|
return value === true;
|
|
return value === true;
|