|
@@ -10,7 +10,7 @@
|
10
|
10
|
<el-row :gutter="20">
|
11
|
11
|
<el-col :span="8">
|
12
|
12
|
<el-table
|
13
|
|
- :data="propForm.goods"
|
|
13
|
+ :data="propForm.goodType"
|
14
|
14
|
ref="table"
|
15
|
15
|
border
|
16
|
16
|
highlight-current-row
|
|
@@ -24,7 +24,8 @@
|
24
|
24
|
align="center"
|
25
|
25
|
label="商品类型">
|
26
|
26
|
<template slot-scope="scope">
|
27
|
|
- <span>{{getGoodTypeName(scope.row)}}</span>
|
|
27
|
+ <!-- <span>{{getGoodTypeName(scope.row)}}</span> -->
|
|
28
|
+ <span>{{scope.row.type_name}}</span>
|
28
|
29
|
</template>
|
29
|
30
|
</el-table-column>
|
30
|
31
|
</el-table>
|
|
@@ -102,7 +103,8 @@
|
102
|
103
|
isClose: false,
|
103
|
104
|
visibility: false,
|
104
|
105
|
SelectedDatas: [],
|
105
|
|
- table_current_index: -1
|
|
106
|
+ table_current_index: -1,
|
|
107
|
+ tableData:[],
|
106
|
108
|
}
|
107
|
109
|
},
|
108
|
110
|
props: {
|
|
@@ -110,6 +112,10 @@
|
110
|
112
|
type: Object
|
111
|
113
|
}
|
112
|
114
|
},
|
|
115
|
+ created(){
|
|
116
|
+ this.tableData = this.propForm.goodType
|
|
117
|
+ console.log("222233333",this.tableData)
|
|
118
|
+ },
|
113
|
119
|
methods: {
|
114
|
120
|
hide: function() {
|
115
|
121
|
this.visibility = false
|
|
@@ -131,30 +137,27 @@
|
131
|
137
|
}
|
132
|
138
|
}
|
133
|
139
|
},
|
134
|
|
- goodTypeTableChange: function(currentRow, oldCurrentRow) {
|
135
|
|
- let keyName = ''
|
136
|
|
- for (var key in currentRow) {
|
137
|
|
- if (key != 'index') {
|
138
|
|
- keyName = key
|
139
|
|
- }
|
140
|
|
- }
|
141
|
|
- this.goodInfoTableData = []
|
142
|
|
- this.goodInfo = []
|
143
|
|
- if (keyName.length > 0) {
|
144
|
|
- this.currentGoodTypeId = parseInt(keyName)
|
145
|
|
- this.goodInfo = currentRow[keyName]
|
146
|
|
- this.goodInfoTableData = (currentRow[keyName])
|
|
140
|
+ goodTypeTableChange: function(currentRow, oldCurrentRow) {
|
|
141
|
+
|
|
142
|
+ let keyName = ""
|
|
143
|
+ var arr = []
|
|
144
|
+ for(let i= 0;i<this.propForm.goods.length;i++){
|
|
145
|
+ for(var key in this.propForm.goods[i]){
|
|
146
|
+ if(key == currentRow.id){
|
|
147
|
+ keyName = key
|
|
148
|
+ arr.push(this.propForm.goods[i])
|
|
149
|
+ }
|
|
150
|
+ }
|
147
|
151
|
}
|
148
|
|
-
|
149
|
|
- for (let i = 0; i < this.goodInfoTableData.length; i++) {
|
150
|
|
- if (this.goodInfoTableData[i].isSelected) {
|
151
|
|
- this.$nextTick(function() {
|
152
|
|
- this.$refs.multipleTable.toggleRowSelection(this.goodInfoTableData[i])
|
153
|
|
- })
|
|
152
|
+ this.currentGoodTypeId = parseInt(keyName)
|
|
153
|
+ this.goodInfoTableData = arr[keyName]
|
|
154
|
+ for(let i=0;i<arr.length;i++){
|
|
155
|
+ for(var key in arr[i]){
|
|
156
|
+ this.goodInfo = arr[i][keyName]
|
|
157
|
+ this.goodInfoTableData = arr[i][keyName]
|
154
|
158
|
}
|
155
|
|
- }
|
156
|
|
-
|
157
|
|
- },
|
|
159
|
+ }
|
|
160
|
+ },
|
158
|
161
|
cancle: function(formName) {
|
159
|
162
|
this.goodInfo = []
|
160
|
163
|
this.goodInfoTableData = []
|
|
@@ -213,22 +216,24 @@
|
213
|
216
|
return this.propForm.goodUnit[i].name
|
214
|
217
|
}
|
215
|
218
|
}
|
216
|
|
- }, search: function() {
|
|
219
|
+ },
|
|
220
|
+
|
|
221
|
+ search:function() {
|
217
|
222
|
if (this.keywords.length <= 0) {
|
218
|
|
- this.$message.error('搜索关键字不能为空')
|
219
|
|
- return
|
|
223
|
+ console.log("0000000",this.propForm.goodType)
|
|
224
|
+ this.propForm.goodType = this.propForm.goodType
|
220
|
225
|
}
|
221
|
226
|
const searchArr = []
|
222
|
|
- for (let i = 0; i < this.goodInfoTableData.length; i++) {
|
223
|
|
- if (this.goodInfoTableData[i].specification_name.indexOf(this.keywords) != -1) {
|
224
|
|
- searchArr.push(this.goodInfoTableData[i])
|
225
|
|
- }
|
226
|
|
- }
|
227
|
|
- this.goodInfoTableData = []
|
228
|
|
- for (let i = 0; i < searchArr.length; i++) {
|
229
|
|
- this.goodInfoTableData.push(searchArr[i])
|
|
227
|
+ for(let i=0;i<this.propForm.goodType.length;i++){
|
|
228
|
+ if(this.propForm.goodType[i].type_name.indexOf(this.keywords)!=-1){
|
|
229
|
+ searchArr.push(this.propForm.goodType[i])
|
|
230
|
+ }
|
230
|
231
|
}
|
231
|
|
- }, changeGoodInfoTableData: function(val) {
|
|
232
|
+ console.log("searchArr",searchArr)
|
|
233
|
+ this.propForm.goodType = []
|
|
234
|
+ this.propForm.goodType = searchArr
|
|
235
|
+ },
|
|
236
|
+ changeGoodInfoTableData: function(val) {
|
232
|
237
|
}, changeAllGoodInfoTableData: function(selection) {
|
233
|
238
|
|
234
|
239
|
var goodInfos = this.propForm.goods[this.table_current_index][this.currentGoodTypeId]
|