Commit 5f548bf8 by zhangquan

修复轮胎历史数据bug

1 parent 253769cc
...@@ -301,6 +301,7 @@ export default { ...@@ -301,6 +301,7 @@ export default {
PC0005: '', PC0005: '',
PC0007: '' PC0007: ''
}, },
allProdList: [],
tdo_list: TDO_LiST, tdo_list: TDO_LiST,
TDOTableData: {}, TDOTableData: {},
footerLeft: '0', footerLeft: '0',
...@@ -1271,20 +1272,7 @@ export default { ...@@ -1271,20 +1272,7 @@ export default {
} }
} }
} }
if (isGetDetail) { if (!isGetDetail) {
blackArr.forEach(element => {
element?.forEach(item => {
if (item.value.attributeGroup == 'tireDTONew' || item.value.attributeGroup == 'tireBatchNew') {
if (!this.TDOTableData[item.name]) this.$set(this.TDOTableData, item.name, {})
if (this.TDOTableData[item.name] && !this.TDOTableData[item.name][item.value.attributeGroup]) {
this.$set(this.TDOTableData[item.name], item.value.attributeGroup, {})
}
this.$set(this.TDOTableData[item.name][item.value.attributeGroup], item.value.sort, item.value.attributeValue)
}
})
})
console.log(this.TDOTableData, 'isGetDetail')
} else {
codeList.forEach((item, index) => { codeList.forEach((item, index) => {
if (this.TDOTableData[item]) { if (this.TDOTableData[item]) {
for (let key in this.TDOTableData[item]) { for (let key in this.TDOTableData[item]) {
...@@ -1564,6 +1552,7 @@ export default { ...@@ -1564,6 +1552,7 @@ export default {
params.tireFlag = 1 params.tireFlag = 1
} }
this.$apis.beforeSale.getNewPackageListApi(params).then(res => { this.$apis.beforeSale.getNewPackageListApi(params).then(res => {
this.allProdList = res
res.forEach((item, index) => { res.forEach((item, index) => {
let obj = null let obj = null
let id = -1 let id = -1
...@@ -1727,7 +1716,15 @@ export default { ...@@ -1727,7 +1716,15 @@ export default {
} }
packCode.push(item.packageCode) packCode.push(item.packageCode)
const _curProdTarget = this.allProdList.find(el => el.packageCode == item.packageCode)
const hasTire = _curProdTarget?.groupAttributeList?.find(el => el.attributeGroup == 'tireDTONew' || el.attributeGroup == 'tireBatchNew')
if (hasTire && !this.TDOTableData[item.packageCode]) {
this.$set(this.TDOTableData, item.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
item.attributeDTOList.forEach(el => { item.attributeDTOList.forEach(el => {
if (this.TDOTableData[item.packageCode] && (el.attributeGroup == 'tireDTONew' || el.attributeGroup == 'tireBatchNew')) {
this.$set(this.TDOTableData[item.packageCode][el.attributeGroup], el.sort, el.attributeValue)
}
attrList.push({ attrList.push({
...el, ...el,
packageCode: item.packageCode, packageCode: item.packageCode,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<!-- <el-button size="small" @click="toggleAll">全选</el-button> --> <!-- <el-button size="small" @click="toggleAll">全选</el-button> -->
<!-- <el-checkbox v-model="checkbox" @change="toggleAll" style="margin-left:20px">全选</el-checkbox> --> <!-- <el-checkbox v-model="checkbox" @change="toggleAll" style="margin-left:20px">全选</el-checkbox> -->
<div style="float: right;" class="primary_plain_btn"> <div style="float: right;" class="primary_plain_btn">
<el-button size="small" plain @click="batchOpenSale()">批量开通驻店销售</el-button> <el-button size="small" plain @click="batchOpenSale()">批量开通驻店零售</el-button>
<el-button size="small" plain @click="batchOperation(1)">批量开通</el-button> <el-button size="small" plain @click="batchOperation(1)">批量开通</el-button>
<el-button size="small" @click="batchOperation(2)">批量关闭</el-button> <el-button size="small" @click="batchOperation(2)">批量关闭</el-button>
<el-button size="small" @click="exportTable">导出</el-button> <el-button size="small" @click="exportTable">导出</el-button>
...@@ -270,6 +270,12 @@ export default { ...@@ -270,6 +270,12 @@ export default {
batchOpenSale(){ batchOpenSale(){
const data = this.$refs.table?.mutiSelectArr?.[this.tableParams.mutiSelectName] || [] const data = this.$refs.table?.mutiSelectArr?.[this.tableParams.mutiSelectName] || []
if(!data?.length) return this.$message.error('请选择需要开通的商户') if(!data?.length) return this.$message.error('请选择需要开通的商户')
this.$confirm('确定批量开通驻店零售吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
const ids = data.map(item => item.id) const ids = data.map(item => item.id)
this.$apis.openconfig.batchOpenSaleModeApi({ids, saleMode: 2}).then(res => { this.$apis.openconfig.batchOpenSaleModeApi({ids, saleMode: 2}).then(res => {
if(res){ if(res){
...@@ -277,6 +283,9 @@ export default { ...@@ -277,6 +283,9 @@ export default {
this.$refs.table.refreshTable() this.$refs.table.refreshTable()
} }
}) })
}
}
})
}, },
// ['开通', '关闭'] // // ['开通', '关闭'] //
batchOperation(status) { batchOperation(status) {
...@@ -304,8 +313,7 @@ export default { ...@@ -304,8 +313,7 @@ export default {
this.$confirm(content[status], '提示', { this.$confirm(content[status], '提示', {
confirmButtonText: '是', confirmButtonText: '是',
cancelButtonText: '否', cancelButtonText: '否',
type: 'warning', type: 'warning'
center: true
}) })
.then(() => { .then(() => {
let target = 'openConfigs' let target = 'openConfigs'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!