|
@@ -132,6 +132,7 @@
|
|
|
<!-- 选择产品 -->
|
|
|
<chooseProductsModal
|
|
|
type="dealership"
|
|
|
+ ref="productBox"
|
|
|
:openModal="openProductsModal"
|
|
|
:chooseData="chooseProducts"
|
|
|
@close="openProductsModal=false"
|
|
@@ -255,21 +256,11 @@ export default {
|
|
|
const _this = this
|
|
|
_this.brandTagIndex = pos
|
|
|
// 每行品牌都是唯一滴
|
|
|
- // const snArr = []
|
|
|
- // const snObjList = []
|
|
|
- // _this.dataSource.forEach(item => {
|
|
|
- // if (item.productBrandList && item.productBrandList.length > 0) {
|
|
|
- // item.productBrandList.forEach(con => {
|
|
|
- // con.goodsSn = con.productBrandSn
|
|
|
- // snArr.push(con.productBrandSn)
|
|
|
- // snObjList.push(con)
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
const dataList = _this.setShowData('Brand')
|
|
|
_this.openBrandModal = true
|
|
|
- _this.chooseBrand = dataList[1]
|
|
|
- _this.$refs.brandBox.handleDisabled(dataList[0])
|
|
|
+ const echoData = _this.handleEchoData('Brand', row.productBrandList)
|
|
|
+ _this.chooseBrand = echoData
|
|
|
+ _this.$refs.brandBox.handleDisabled(dataList)
|
|
|
},
|
|
|
handleBrandOk (conList) {
|
|
|
const newConList = conList.map(con => {
|
|
@@ -282,9 +273,12 @@ export default {
|
|
|
},
|
|
|
// 添加产品
|
|
|
addProductTag (pos, row) {
|
|
|
+ debugger
|
|
|
this.productTagIndex = pos
|
|
|
const dataList = this.setShowData('This')
|
|
|
- this.chooseProducts = dataList[1]
|
|
|
+ const echoData = this.handleEchoData('This', row.productThisList)
|
|
|
+ this.chooseProducts = echoData
|
|
|
+ this.$refs.productBox.handleDisabled(dataList)
|
|
|
this.openProductsModal = true
|
|
|
},
|
|
|
handleProductsOk (arr) {
|
|
@@ -302,22 +296,26 @@ export default {
|
|
|
setShowData (name) {
|
|
|
const _this = this
|
|
|
const snArr = []
|
|
|
- const snObjList = []
|
|
|
_this.dataSource.forEach(item => {
|
|
|
if (item['product' + name + 'List'] && item['product' + name + 'List'].length > 0) {
|
|
|
item['product' + name + 'List'].forEach(con => {
|
|
|
- if (name === 'This') {
|
|
|
- con.goodsSn = con.productSn
|
|
|
- snArr.push(con.productSn)
|
|
|
- } else {
|
|
|
- con.goodsSn = con['product' + name + 'Sn']
|
|
|
- snArr.push(con['product' + name + 'Sn'])
|
|
|
- }
|
|
|
- snObjList.push(con)
|
|
|
+ const newName = name === 'This' ? '' : name
|
|
|
+ snArr.push(con['product' + newName + 'Sn'])
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- return [snArr, snObjList]
|
|
|
+ return snArr
|
|
|
+ },
|
|
|
+ handleEchoData (name, conArr) {
|
|
|
+ conArr.map(item => {
|
|
|
+ if (name === 'This') {
|
|
|
+ item.code = item.productCode
|
|
|
+ item.goodsSn = item.productSn
|
|
|
+ } else {
|
|
|
+ item.goodsSn = item['product' + name + 'Sn']
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return conArr
|
|
|
},
|
|
|
getResultVal () {
|
|
|
const resultObj = JSON.parse(JSON.stringify(this.dataSource))
|