|
|
@@ -339,8 +339,13 @@
|
|
|
})
|
|
|
},
|
|
|
tbprod(row, index) {
|
|
|
- this.isDan = true;
|
|
|
- this.upGoods(row, index)
|
|
|
+ try{
|
|
|
+ this.isDan = true;
|
|
|
+ this.upGoods(row, index)
|
|
|
+ }catch(err) {
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
changeSwitch(row) {
|
|
|
console.log(row, row.id, row.is_show)
|
|
|
@@ -398,6 +403,7 @@
|
|
|
// that.upGoods(that.tableList[index],index)
|
|
|
},
|
|
|
setUpdate(good) {
|
|
|
+ console.log(good,'good')
|
|
|
return {
|
|
|
"stock": 10,
|
|
|
"is_weigh": good.is_weigh,
|
|
|
@@ -418,7 +424,7 @@
|
|
|
"freight": 1,
|
|
|
"postage": 0,
|
|
|
"custom_form": [],
|
|
|
- "cate_id": [
|
|
|
+ "cate_id": (good.cate_id && good.cate_id.split(','))||[
|
|
|
1,
|
|
|
2
|
|
|
],
|
|
|
@@ -499,20 +505,26 @@
|
|
|
}
|
|
|
},
|
|
|
upGoods(good, index) {
|
|
|
- let qdata = this.setUpdate()
|
|
|
- if (this.stId && this.stId > good.id) {
|
|
|
- return;
|
|
|
- }
|
|
|
- productAddApi(qdata).then(res => {
|
|
|
- this.$Message.success(res.msg);
|
|
|
- if (this.isDan) {
|
|
|
- return this.isDan = false;
|
|
|
- } else {
|
|
|
- index++;
|
|
|
- this.begin(index);
|
|
|
+ try {
|
|
|
+ let qdata = this.setUpdate(good)
|
|
|
+ if (this.stId && this.stId > good.id) {
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
- })
|
|
|
+ productAddApi(qdata).then(res => {
|
|
|
+ this.$Message.success(res.msg);
|
|
|
+ if (this.isDan) {
|
|
|
+ return this.isDan = false;
|
|
|
+ } else {
|
|
|
+ index++;
|
|
|
+ this.begin(index);
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error,'error')
|
|
|
+ //TODO handle the exception
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
look(row) {
|
|
|
try {
|