|
@@ -588,6 +588,74 @@ export class UserData {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ // 获取入库单列表
|
|
|
+ async geteEnterStoreList(code:string,size: number): 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`, {code:code,size:size},
|
|
|
+ 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);
|
|
|
+ const toast = await this.toastCtrl.create({
|
|
|
+ message: '查询失败',
|
|
|
+ duration: 1000,
|
|
|
+ position: 'top'
|
|
|
+ });
|
|
|
+ await toast.present();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取入库单详情
|
|
|
+ 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);
|
|
|
+ const toast = await this.toastCtrl.create({
|
|
|
+ message: '获取失败',
|
|
|
+ duration: 1000,
|
|
|
+ position: 'top'
|
|
|
+ });
|
|
|
+ await toast.present();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// 获取入库详情
|
|
|
async getStoreDetail(sscId: number, pId: number): Promise<any> {
|
|
|
const token = await this.getToken();
|
|
@@ -988,6 +1056,40 @@ 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);
|
|
|
+ const toast = await this.toastCtrl.create({
|
|
|
+ message: '查询失败',
|
|
|
+ duration: 1000,
|
|
|
+ position: 'top'
|
|
|
+ });
|
|
|
+ await toast.present();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// 获取待备货列表
|
|
|
async getWarehouseManagePendingList(current: number, size: number): Promise<any> {
|
|
|
const token = await this.getToken();
|
|
@@ -1000,7 +1102,6 @@ export class UserData {
|
|
|
headers)).pipe(
|
|
|
finalize(() => loading.dismiss())
|
|
|
).subscribe(async data => {
|
|
|
- console.log(data)
|
|
|
if (data.data === null || JSON.parse(data.data).data.records == null) {
|
|
|
const toast = await this.toastCtrl.create({
|
|
|
message: '无数据',
|