|
@@ -1,8 +1,9 @@
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
import { UserData } from '../../providers/user-data';
|
|
|
import { commonService } from '../../providers/common.service';
|
|
|
-import { Keyboard } from '@ionic-native/keyboard/ngx';
|
|
|
-import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
|
|
+import { Router } from '@angular/router';
|
|
|
+import { Storage } from '@ionic/storage'
|
|
|
+
|
|
|
@Component({
|
|
|
selector: 'app-store-pending',
|
|
|
templateUrl: './store-pending.page.html',
|
|
@@ -16,8 +17,10 @@ export class StorePendingPage implements OnInit {
|
|
|
storeQCDetailList = []
|
|
|
|
|
|
constructor(public userData: UserData,
|
|
|
- public commonService: commonService,
|
|
|
- ) { }
|
|
|
+ private storage: Storage,
|
|
|
+ private router: Router,
|
|
|
+ public commonService: commonService,
|
|
|
+ ) { }
|
|
|
|
|
|
ngOnInit() {
|
|
|
}
|
|
@@ -33,40 +36,45 @@ export class StorePendingPage implements OnInit {
|
|
|
async getList() {
|
|
|
let data = await this.userData.getStorePendingList(this.current, this.size)
|
|
|
this.pendingList = data
|
|
|
- for(let i of this.pendingList) {
|
|
|
- if(i["pictures"] && i["pictures"].length!==0) {
|
|
|
+ for (let i of this.pendingList) {
|
|
|
+ if (i["pictures"] && i["pictures"].length !== 0) {
|
|
|
i["imgsrc"] = i["pictures"][0].smallPicture
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ doRefresh(event) {
|
|
|
+ this.getList()
|
|
|
+ event.target.complete(); //告诉ion-refresher 更新数据
|
|
|
+ }
|
|
|
+
|
|
|
// 获取扫描详情
|
|
|
async getStoreQCDetail(pending) {
|
|
|
+ this.storage.set('store-pending', pending).then(() => {
|
|
|
+ this.router.navigateByUrl('/store-qc-scanning')
|
|
|
+ })
|
|
|
+ // let data = await this.userData.getQCDetail(pending.sscId, pending.pId)
|
|
|
|
|
|
- let data = await this.userData.getQCDetail(pending.sscId, pending.pId)
|
|
|
+ // this.storeQCDetailList = new Array(data)
|
|
|
|
|
|
- this.storeQCDetailList = new Array(data)
|
|
|
-
|
|
|
- for (let i of this.storeQCDetailList) {
|
|
|
- // 获取QA日志
|
|
|
- let qalogdata = await this.userData.getQAlog(i.sscId, i.pid)
|
|
|
- if (JSON.parse(qalogdata).data.length !== 0) {
|
|
|
- i.qalog = JSON.parse(qalogdata).data[0].mark
|
|
|
- i.qaimgUrl = JSON.parse(qalogdata).data[0].picture.split(",")[0]
|
|
|
- }
|
|
|
- let qclogdata = await this.userData.getQClog(i.sscId, i.pid)
|
|
|
- if (JSON.parse(qclogdata).data.length !== 0) {
|
|
|
- i.qclog = JSON.parse(qclogdata).data[0].mark
|
|
|
- i.qcimgUrl = JSON.parse(qclogdata).data[0].picture.split(",")[0]
|
|
|
- }
|
|
|
- // 处理意见转换boolean
|
|
|
- if (i.dealpropose == 1) {
|
|
|
- i.deal = true
|
|
|
- } else {
|
|
|
- i.deal = false
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (let i of this.storeQCDetailList) {
|
|
|
+ // // 获取QA日志
|
|
|
+ // let qalogdata = await this.userData.getQAlog(i.sscId, i.pid)
|
|
|
+ // if (JSON.parse(qalogdata).data.length !== 0) {
|
|
|
+ // i.qalog = JSON.parse(qalogdata).data[0].mark
|
|
|
+ // i.qaimgUrl = JSON.parse(qalogdata).data[0].picture.split(",")[0]
|
|
|
+ // }
|
|
|
+ // let qclogdata = await this.userData.getQClog(i.sscId, i.pid)
|
|
|
+ // if (JSON.parse(qclogdata).data.length !== 0) {
|
|
|
+ // i.qclog = JSON.parse(qclogdata).data[0].mark
|
|
|
+ // i.qcimgUrl = JSON.parse(qclogdata).data[0].picture.split(",")[0]
|
|
|
+ // }
|
|
|
+ // // 处理意见转换boolean
|
|
|
+ // if (i.dealpropose == 1) {
|
|
|
+ // i.deal = true
|
|
|
+ // } else {
|
|
|
+ // i.deal = false
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
}
|