|
@@ -165,28 +165,31 @@ export default {
|
|
|
this.queryParam.salesBillSn = this.salesBillSn
|
|
|
return salesDetailAllList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
let data = res.data
|
|
|
- // 根据类型过滤数据
|
|
|
- data = data.filter(item => {
|
|
|
- if (this.queryParam.ptype == '1') {
|
|
|
- return item != null && item.surplusQty > 0
|
|
|
+ if (data) {
|
|
|
+ // 根据类型过滤数据
|
|
|
+ data = data.filter(item => {
|
|
|
+ if (this.queryParam.ptype == '1') {
|
|
|
+ return item != null && item.surplusQty > 0
|
|
|
+ }
|
|
|
+ if (this.queryParam.ptype == '2') {
|
|
|
+ return item != null && item.surplusQty > 0 && item.surplusQty <= item.stockQty
|
|
|
+ }
|
|
|
+ if (this.queryParam.ptype == '3') {
|
|
|
+ return item != null && item.surplusQty > item.stockQty
|
|
|
+ }
|
|
|
+ if (this.queryParam.ptype == '0') {
|
|
|
+ return item != null
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 增加编号
|
|
|
+ const no = 0
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ data[i].no = no + i + 1
|
|
|
+ data[i].cancelNums = data[i].surplusQty
|
|
|
}
|
|
|
- if (this.queryParam.ptype == '2') {
|
|
|
- return item != null && item.surplusQty > 0 && item.surplusQty <= item.stockQty
|
|
|
- }
|
|
|
- if (this.queryParam.ptype == '3') {
|
|
|
- return item != null && item.surplusQty > item.stockQty
|
|
|
- }
|
|
|
- if (this.queryParam.ptype == '0') {
|
|
|
- return item != null
|
|
|
- }
|
|
|
- })
|
|
|
- // 增加编号
|
|
|
- const no = 0
|
|
|
- for (var i = 0; i < data.length; i++) {
|
|
|
- data[i].no = no + i + 1
|
|
|
- data[i].cancelNums = data[i].surplusQty
|
|
|
+ this.disabled = false
|
|
|
}
|
|
|
- this.disabled = false
|
|
|
+
|
|
|
return data
|
|
|
})
|
|
|
}
|