فهرست منبع

添加仓库备货模块

zhoutao 5 سال پیش
والد
کامیت
95e972979c

+ 42 - 124
package-lock.json

@@ -841,21 +841,6 @@
         }
       }
     },
-    "@ionic-native/photo-viewer": {
-      "version": "5.16.0",
-      "resolved": "https://registry.npmjs.org/@ionic-native/photo-viewer/-/photo-viewer-5.16.0.tgz",
-      "integrity": "sha512-clGX8tbtV7yr/2BvNH16NzMRhHCUsQn/aLUifHzqJq76FqdbXhUcgGiRmDCRsIvFBEycRxjTJfs+KX1eprSOnQ==",
-      "requires": {
-        "@types/cordova": "^0.0.34"
-      },
-      "dependencies": {
-        "@types/cordova": {
-          "version": "0.0.34",
-          "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
-          "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
-        }
-      }
-    },
     "@ionic-native/splash-screen": {
       "version": "5.5.1",
       "resolved": "https://registry.npmjs.org/@ionic-native/splash-screen/-/splash-screen-5.5.1.tgz",
@@ -2317,11 +2302,6 @@
       "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz",
       "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM="
     },
-    "com-sarriaroman-photoviewer": {
-      "version": "1.2.4",
-      "resolved": "https://registry.npmjs.org/com-sarriaroman-photoviewer/-/com-sarriaroman-photoviewer-1.2.4.tgz",
-      "integrity": "sha512-ousSeDOkFPDGAexPTknye18GgQZLZGPh32D+JTyoLbxrLmk1cy7kgAytNWAHgoz7wjP9OJF6w+Zj1qfuLoW31g=="
-    },
     "combined-stream": {
       "version": "1.0.8",
       "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
@@ -3374,6 +3354,11 @@
         "is-symbol": "^1.0.2"
       }
     },
+    "es.keensoft.fullscreenimage": {
+      "version": "0.2.10",
+      "resolved": "https://registry.npmjs.org/es.keensoft.fullscreenimage/-/es.keensoft.fullscreenimage-0.2.10.tgz",
+      "integrity": "sha1-V2MANyJUpMbt8kK51I/7ZIcbqPU="
+    },
     "es6-promise": {
       "version": "4.2.6",
       "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz",
@@ -3936,7 +3921,6 @@
       "version": "1.2.9",
       "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz",
       "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==",
-      "optional": true,
       "requires": {
         "nan": "^2.12.1",
         "node-pre-gyp": "^0.12.0"
@@ -3944,23 +3928,19 @@
       "dependencies": {
         "abbrev": {
           "version": "1.1.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "ansi-regex": {
           "version": "2.1.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "aproba": {
           "version": "1.2.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "are-we-there-yet": {
           "version": "1.1.5",
           "bundled": true,
-          "optional": true,
           "requires": {
             "delegates": "^1.0.0",
             "readable-stream": "^2.0.6"
@@ -3968,13 +3948,11 @@
         },
         "balanced-match": {
           "version": "1.0.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "brace-expansion": {
           "version": "1.1.11",
           "bundled": true,
-          "optional": true,
           "requires": {
             "balanced-match": "^1.0.0",
             "concat-map": "0.0.1"
@@ -3982,69 +3960,57 @@
         },
         "chownr": {
           "version": "1.1.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "code-point-at": {
           "version": "1.1.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "concat-map": {
           "version": "0.0.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "console-control-strings": {
           "version": "1.1.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "core-util-is": {
           "version": "1.0.2",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "debug": {
           "version": "4.1.1",
           "bundled": true,
-          "optional": true,
           "requires": {
             "ms": "^2.1.1"
           }
         },
         "deep-extend": {
           "version": "0.6.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "delegates": {
           "version": "1.0.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "detect-libc": {
           "version": "1.0.3",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "fs-minipass": {
           "version": "1.2.5",
           "bundled": true,
-          "optional": true,
           "requires": {
             "minipass": "^2.2.1"
           }
         },
         "fs.realpath": {
           "version": "1.0.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "gauge": {
           "version": "2.7.4",
           "bundled": true,
-          "optional": true,
           "requires": {
             "aproba": "^1.0.3",
             "console-control-strings": "^1.0.0",
@@ -4059,7 +4025,6 @@
         "glob": {
           "version": "7.1.3",
           "bundled": true,
-          "optional": true,
           "requires": {
             "fs.realpath": "^1.0.0",
             "inflight": "^1.0.4",
@@ -4071,13 +4036,11 @@
         },
         "has-unicode": {
           "version": "2.0.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "iconv-lite": {
           "version": "0.4.24",
           "bundled": true,
-          "optional": true,
           "requires": {
             "safer-buffer": ">= 2.1.2 < 3"
           }
@@ -4085,7 +4048,6 @@
         "ignore-walk": {
           "version": "3.0.1",
           "bundled": true,
-          "optional": true,
           "requires": {
             "minimatch": "^3.0.4"
           }
@@ -4093,7 +4055,6 @@
         "inflight": {
           "version": "1.0.6",
           "bundled": true,
-          "optional": true,
           "requires": {
             "once": "^1.3.0",
             "wrappy": "1"
@@ -4101,44 +4062,37 @@
         },
         "inherits": {
           "version": "2.0.3",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "ini": {
           "version": "1.3.5",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "is-fullwidth-code-point": {
           "version": "1.0.0",
           "bundled": true,
-          "optional": true,
           "requires": {
             "number-is-nan": "^1.0.0"
           }
         },
         "isarray": {
           "version": "1.0.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "minimatch": {
           "version": "3.0.4",
           "bundled": true,
-          "optional": true,
           "requires": {
             "brace-expansion": "^1.1.7"
           }
         },
         "minimist": {
           "version": "0.0.8",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "minipass": {
           "version": "2.3.5",
           "bundled": true,
-          "optional": true,
           "requires": {
             "safe-buffer": "^5.1.2",
             "yallist": "^3.0.0"
@@ -4147,7 +4101,6 @@
         "minizlib": {
           "version": "1.2.1",
           "bundled": true,
-          "optional": true,
           "requires": {
             "minipass": "^2.2.1"
           }
@@ -4155,20 +4108,17 @@
         "mkdirp": {
           "version": "0.5.1",
           "bundled": true,
-          "optional": true,
           "requires": {
             "minimist": "0.0.8"
           }
         },
         "ms": {
           "version": "2.1.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "needle": {
           "version": "2.3.0",
           "bundled": true,
-          "optional": true,
           "requires": {
             "debug": "^4.1.0",
             "iconv-lite": "^0.4.4",
@@ -4178,7 +4128,6 @@
         "node-pre-gyp": {
           "version": "0.12.0",
           "bundled": true,
-          "optional": true,
           "requires": {
             "detect-libc": "^1.0.2",
             "mkdirp": "^0.5.1",
@@ -4195,7 +4144,6 @@
         "nopt": {
           "version": "4.0.1",
           "bundled": true,
-          "optional": true,
           "requires": {
             "abbrev": "1",
             "osenv": "^0.1.4"
@@ -4203,13 +4151,11 @@
         },
         "npm-bundled": {
           "version": "1.0.6",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "npm-packlist": {
           "version": "1.4.1",
           "bundled": true,
-          "optional": true,
           "requires": {
             "ignore-walk": "^3.0.1",
             "npm-bundled": "^1.0.1"
@@ -4218,7 +4164,6 @@
         "npmlog": {
           "version": "4.1.2",
           "bundled": true,
-          "optional": true,
           "requires": {
             "are-we-there-yet": "~1.1.2",
             "console-control-strings": "~1.1.0",
@@ -4228,36 +4173,30 @@
         },
         "number-is-nan": {
           "version": "1.0.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "object-assign": {
           "version": "4.1.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "once": {
           "version": "1.4.0",
           "bundled": true,
-          "optional": true,
           "requires": {
             "wrappy": "1"
           }
         },
         "os-homedir": {
           "version": "1.0.2",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "os-tmpdir": {
           "version": "1.0.2",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "osenv": {
           "version": "0.1.5",
           "bundled": true,
-          "optional": true,
           "requires": {
             "os-homedir": "^1.0.0",
             "os-tmpdir": "^1.0.0"
@@ -4265,18 +4204,15 @@
         },
         "path-is-absolute": {
           "version": "1.0.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "process-nextick-args": {
           "version": "2.0.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "rc": {
           "version": "1.2.8",
           "bundled": true,
-          "optional": true,
           "requires": {
             "deep-extend": "^0.6.0",
             "ini": "~1.3.0",
@@ -4286,15 +4222,13 @@
           "dependencies": {
             "minimist": {
               "version": "1.2.0",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             }
           }
         },
         "readable-stream": {
           "version": "2.3.6",
           "bundled": true,
-          "optional": true,
           "requires": {
             "core-util-is": "~1.0.0",
             "inherits": "~2.0.3",
@@ -4308,45 +4242,37 @@
         "rimraf": {
           "version": "2.6.3",
           "bundled": true,
-          "optional": true,
           "requires": {
             "glob": "^7.1.3"
           }
         },
         "safe-buffer": {
           "version": "5.1.2",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "safer-buffer": {
           "version": "2.1.2",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "sax": {
           "version": "1.2.4",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "semver": {
           "version": "5.7.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "set-blocking": {
           "version": "2.0.0",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "signal-exit": {
           "version": "3.0.2",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "string-width": {
           "version": "1.0.2",
           "bundled": true,
-          "optional": true,
           "requires": {
             "code-point-at": "^1.0.0",
             "is-fullwidth-code-point": "^1.0.0",
@@ -4356,7 +4282,6 @@
         "string_decoder": {
           "version": "1.1.1",
           "bundled": true,
-          "optional": true,
           "requires": {
             "safe-buffer": "~5.1.0"
           }
@@ -4364,20 +4289,17 @@
         "strip-ansi": {
           "version": "3.0.1",
           "bundled": true,
-          "optional": true,
           "requires": {
             "ansi-regex": "^2.0.0"
           }
         },
         "strip-json-comments": {
           "version": "2.0.1",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "tar": {
           "version": "4.4.8",
           "bundled": true,
-          "optional": true,
           "requires": {
             "chownr": "^1.1.1",
             "fs-minipass": "^1.2.5",
@@ -4390,26 +4312,22 @@
         },
         "util-deprecate": {
           "version": "1.0.2",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "wide-align": {
           "version": "1.1.3",
           "bundled": true,
-          "optional": true,
           "requires": {
             "string-width": "^1.0.2 || 2"
           }
         },
         "wrappy": {
           "version": "1.0.2",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         },
         "yallist": {
           "version": "3.0.3",
-          "bundled": true,
-          "optional": true
+          "bundled": true
         }
       }
     },

+ 1 - 1
package.json

@@ -123,4 +123,4 @@
       "android"
     ]
   }
-}
+}

+ 30 - 14
src/app/app.component.html

@@ -76,49 +76,65 @@
         </ion-list>
 
 
-
         <ion-list *ngIf="loggedIn">
           <!-- <ion-list> -->
           <ion-list-header>
-            仓库
+            仓库样品
           </ion-list-header>
           <ion-menu-toggle autoHide="false">
-            <ion-item routerLink="/enter-store">
-              <ion-icon slot="start" name="appstore"></ion-icon>
+            <ion-item routerLink="/store-sample-pending">
+              <ion-icon slot="start" name="timer"></ion-icon>
               <ion-label>
-                入库单
+                待备样
               </ion-label>
             </ion-item>
           </ion-menu-toggle>
 
-
           <ion-menu-toggle autoHide="false">
-            <ion-item routerLink="/store-sample-pending">
+            <ion-item routerLink="/store-sample-binding">
               <ion-icon slot="start" name="timer"></ion-icon>
               <ion-label>
-                待备
+                样品绑定
               </ion-label>
             </ion-item>
           </ion-menu-toggle>
 
           <ion-menu-toggle autoHide="false">
-            <ion-item routerLink="/warehouse-manage-pending">
-              <ion-icon slot="start" name="timer"></ion-icon>
+            <ion-item routerLink="/store-sample">
+              <ion-icon slot="start" name="home"></ion-icon>
               <ion-label>
-                待备货
+                样品列表
               </ion-label>
             </ion-item>
           </ion-menu-toggle>
+        </ion-list>
+
 
+        <ion-list *ngIf="loggedIn">
+          <!-- <ion-list> -->
+          <ion-list-header>
+            仓库管理
+          </ion-list-header>
           <ion-menu-toggle autoHide="false">
-            <ion-item routerLink="/store-sample">
-              <ion-icon slot="start" name="home"></ion-icon>
+            <ion-item routerLink="/enter-store">
+              <ion-icon slot="start" name="appstore"></ion-icon>
               <ion-label>
-                仓库样品
+                入库扫描
               </ion-label>
             </ion-item>
           </ion-menu-toggle>
 
+          <ion-menu-toggle autoHide="false">
+            <ion-item routerLink="/warehouse-manage-pending">
+              <ion-icon slot="start" name="timer"></ion-icon>
+              <ion-label>
+                待备货
+              </ion-label>
+            </ion-item>
+          </ion-menu-toggle>
+
+
+
         </ion-list>
 
 

+ 5 - 0
src/app/warehouse-manage-pending/warehouse-manage-pending.page.html

@@ -61,6 +61,11 @@
         <ion-label>更新时间: </ion-label>
         <ion-datetime [(ngModel)]="storeSample.updatetime" readonly></ion-datetime>
       </ion-item> -->
+
+      <div class="ion-padding">
+        <ion-button color="primary" type="submit" expand="block" (click)="prepareGoods()">
+          备货完成</ion-button>
+      </div>
     </ion-card-content>
   </ion-card>
 </ion-content>

+ 5 - 9
src/app/warehouse-manage-pending/warehouse-manage-pending.page.ts

@@ -17,7 +17,8 @@ export class WarehouseManagePendingPage implements OnInit {
       private keyboard: Keyboard,
       public userData: UserData) { }
   scanCode: string;
-
+  pId = ''
+  sscId = ''
   ngOnInit() {
 
   }
@@ -44,15 +45,10 @@ export class WarehouseManagePendingPage implements OnInit {
   }
 
 
+  async prepareGoods() {
+    await this.userData.prepareGoods(Number(this.sscId), Number(this.pId));
+    }
 
-  // 通过code获取仓库样品详情
-  async getStoreSampleDetail() {
-    this.keyboard.hide();
-    const data = await this.userData.getStoreSampleDetail(this.scanCode);
-    const code = JSON.parse(data).data.code;
-    await this.userData.changeShelfLend(code);
-    this.getList();
-  }
 
 }
 

+ 45 - 0
src/providers/user-data.ts

@@ -777,6 +777,50 @@ export class UserData {
     });
   }
 
+  prepareGoods(sscId: number, pId: number) {
+    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.put(`http://dev.sgsino.cn/inventory/warehouse/mobile/?${sscId}&${pId}`, {},
+          headers)).pipe(
+          finalize(() => loading.dismiss())
+      ).subscribe(async data => {
+        let message = '';
+        if (JSON.parse(data.data).code === 0) {
+          message = `备货完成`;
+        } else if (JSON.parse(data.data).code === 1) {
+          message = JSON.parse(data.data).msg;
+        }
+        const alert = await this.alertController.create({
+          // header: 'Confirm!',
+          message,
+          buttons: [
+            {
+              text: '确定',
+              role: 'cancel',
+              cssClass: 'secondary',
+              handler: (blah) => {
+              }
+            }
+          ]
+        });
+        await alert.present();
+        resolve(data.data);
+      }, async err => {
+        console.log(err);
+        const toast = await this.toastCtrl.create({
+          message: '保存失败',
+          duration: 1000,
+          position: 'top'
+        });
+        await toast.present();
+      });
+    });
+  }
+
   // 获取QC验货初检报告列表
   async getQCList(current: number, size: number): Promise<any> {
     const token = await this.getToken();
@@ -948,4 +992,5 @@ export class UserData {
   //     return value;
   //   });
   // }
+
 }