|
@@ -1103,6 +1103,96 @@ export class UserData {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // qc驳回样品准备
|
|
|
|
+ async rejectSample(sscId: any, pId: 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.put(`${environment.APP_SERVE_URL}/inventory/qc/mobile/rejectSample?sscId=${sscId}&pId=${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: 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 rejectWarehouse(sscId: any, pId: 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.put(`${environment.APP_SERVE_URL}/inventory/qc/mobile/rejectWarehouse?sscId=${sscId}&pId=${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: 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验货初检报告详情
|
|
// 获取QC验货初检报告详情
|
|
async getQCDetail(sscId: number, pId: number): Promise<any> {
|
|
async getQCDetail(sscId: number, pId: number): Promise<any> {
|
|
const token = await this.getToken();
|
|
const token = await this.getToken();
|