|
|
@@ -7,7 +7,7 @@
|
|
|
@select="handleSelectionChange" @select-all="handleAllSelect">
|
|
|
<el-table-column type="selection" width="55">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="type_name" label="规格" align="center">
|
|
|
+ <el-table-column prop="name" label="规格" align="center">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="packet" label="包装箱" align="center">
|
|
|
<template #default="{row}">
|
|
|
@@ -89,16 +89,13 @@
|
|
|
//获取规格 ;
|
|
|
Yunqi.ajax.get('shop/shop_list/get_box', { ids: Yunqi.data.ids, type_id: this.tabValue }, false, false, true).then(res => {
|
|
|
//编辑数据
|
|
|
-
|
|
|
- console.log(res,"res-----------")
|
|
|
-
|
|
|
if (res.length > 0) {
|
|
|
for (var key in Object(res)) {
|
|
|
let index = this.tableData.findIndex(item => item.value == res[key]['id']);
|
|
|
if (index != -1) {
|
|
|
this.tableData.splice(index, 1)
|
|
|
} else {
|
|
|
- this.tableData.push({ value: res[key]['product_id'], price: res[key]['price'], box_id: res[key]['box_id'], fast_mail: res[key]['fast_mail'],box_name: res[key]['box_name'], type_name: res[key]['type_name'], type_id: this.tabValue });
|
|
|
+ this.tableData.push({name: res[key]['title'], value: res[key]['product_id'], price: res[key]['price'], box_id: res[key]['box_id'], fast_mail: res[key]['fast_mail'],box_name: res[key]['box_name'], type_name: res[key]['type_name'], type_id: this.tabValue });
|
|
|
}
|
|
|
}
|
|
|
console.log(this.tableData,"获取到的表格数据");
|
|
|
@@ -135,7 +132,10 @@
|
|
|
|
|
|
if (matched) {
|
|
|
// this.tableData[index] = { name: 'kam', value: 3, price: '111', type_id: '4', packet: '3' }
|
|
|
+
|
|
|
+
|
|
|
if (matched.product_id) {
|
|
|
+ this.tableData[index].name = matched.name
|
|
|
this.tableData[index].box_name = matched.box_name
|
|
|
this.tableData[index].type_name = matched.type_name
|
|
|
this.tableData[index].price = matched.price
|
|
|
@@ -167,7 +167,6 @@
|
|
|
},
|
|
|
onLoad: function (query) {
|
|
|
let row = Yunqi.data.row;
|
|
|
- console.log(row, '===')
|
|
|
if (row) {
|
|
|
this.type = 1
|
|
|
const grouped = JSON.parse(row).reduce((acc, item) => {
|
|
|
@@ -175,7 +174,6 @@
|
|
|
if (!acc[key]) {
|
|
|
acc[key] = [];
|
|
|
}
|
|
|
-
|
|
|
acc[key].push(item);
|
|
|
return acc;
|
|
|
}, {});
|