修改完成
This commit is contained in:
tczjx58520 2020-05-07 12:00:28 +08:00
parent d9b0c4e5dc
commit 136ea489b6
6 changed files with 32 additions and 18 deletions

View file

@ -342,6 +342,7 @@ export default {
flag++
this.$refs.editable.insert(val[i])
}
console.log('i=======================', i, flag)
}
if (flag === 0) {
this.$notify.error({

View file

@ -276,8 +276,10 @@ export default {
this.$refs.editable.removeSelecteds()
const nowlistdata2 = this.deepClone(this.$refs.editable2.getRecords())
this.$refs.editable2.clear()
for (let j = 0; j < this.nowlistdata2.length; j++) {
console.log('nowlistdata2=========', nowlistdata2)
for (let j = 0; j < nowlistdata2.length; j++) {
for (let i = 0; i < this.deleteselectdata.length; i++) {
console.log('删除操作======', this.deleteselectdata[i], nowlistdata2[j])
if (this.deleteselectdata[i] === nowlistdata2[j].idx) {
nowlistdata2.splice(j, 1)
j--
@ -392,12 +394,6 @@ export default {
productdetail4(val) {
console.log('val', val)
const nowlistdata = this.$refs.editable.getRecords()
// nowlistdata.forEach(item => {
// const index = val.findIndex(items => items.productCode === item.productCode)
// if (index > -1) {
// val.splice(index, 1, item)
// }
// })
const alldata = [...val, ...nowlistdata]
const filterdata = this.uniqueArray(alldata, 'productCode')
this.list2 = filterdata

View file

@ -1,5 +1,5 @@
<template>
<el-dialog :visible.sync="productVisible" :materialcontrol="materialcontrol" :close-on-press-escape="false" :title="$t('Hmodule.xzsp')" top="10px" append-to-body @close="$emit('update:materialcontrol', false)">
<el-dialog :visible.sync="productVisible" :materialcontrol="materialcontrol" :close-on-press-escape="false" :title="$t('Hmodule.xzsp')" width="1010px" top="10px" append-to-body @close="$emit('update:materialcontrol', false)">
<div class="filter-container">
<!-- 搜索条件栏目 -->
<el-input v-model="getemplist.productCode" :placeholder="$t('Hmodule.wpbh')" class="filter-item" clearable @keyup.enter.native="handleFilter"/>
@ -55,7 +55,7 @@
<el-table-column :reserve-selection="true" type="selection" min-width="55" align="center"/>
<el-table-column :label="$t('Hmodule.xh')" min-width="55" align="center" type="index"/>
<el-table-column :label="$t('Hmodule.wpbh')" prop="productCode" align="center" min-width="150px"/>
<el-table-column :label="$t('Hmodule.wpmc')" prop="productName" align="center" min-width="150px"/>
<el-table-column :label="$t('Hmodule.wpmc')" prop="productName" align="center" min-width="450px"/>
<el-table-column :label="$t('Hmodule.gg')" prop="productTypeName" align="center" min-width="150px"/>
<el-table-column :label="$t('Hmodule.dw')" prop="unit" align="center" min-width="150px"/>
<el-table-column :label="$t('updates.ys')" prop="color" align="center" min-width="150px"/>

View file

@ -2121,11 +2121,16 @@ export default {
this.control = true
},
async productdetail(val) {
const nowlistdata = this.$refs.editable.getRecords()
this.$refs.editable.clear()
console.log('val============', val)
for (let i = 0; i < val.length; i++) {
val[i].quantity = 1
this.$refs.editable.insert(val[i])
const alldata = [...nowlistdata, ...val]
const filterdata = this.uniqueArray(alldata, 'productCode')
console.log('filterdata=====', filterdata)
// this.list2 = filterdata
for (let i = 0; i < filterdata.length; i++) {
// val[i].quantity = 1
this.$refs.editable.insert(filterdata[i])
}
// const that = this
// this.list2 = val
@ -2144,6 +2149,23 @@ export default {
// }))
// console.log('list', list)
},
uniqueArray(array, key) {
var result = [array[0]]
for (var i = 1; i < array.length; i++) {
var item = array[i]
var repeat = false
for (var j = 0; j < result.length; j++) {
if (item[key] === result[j][key]) {
repeat = true
break
}
}
if (!repeat) {
result.push(item)
}
}
return result
},
//
handleAddGift() {
if (this.saleRepositoryId === null || this.saleRepositoryId === '' || this.saleRepositoryId === undefined) {

View file

@ -371,11 +371,6 @@ export default {
rowspan: _row,
colspan: _col
}
} else if (columnIndex === 6) {
return {
rowspan: _row,
colspan: _col
}
} else if (columnIndex === 7) {
return {
rowspan: _row,

View file

@ -667,7 +667,7 @@ export default {
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
const _row = this.spanArr[rowIndex]
const _col = _row > 0 ? 1 : 0
if (columnIndex !== 2 && columnIndex !== 3 && columnIndex !== 4 && columnIndex !== 5) {
if (columnIndex !== 2 && columnIndex !== 3 && columnIndex !== 4 && columnIndex !== 5 && columnIndex !== 6) {
return {
rowspan: _row,
colspan: _col