Commit 13aefdbb authored by hubaoshan's avatar hubaoshan

wcp

parent 5db4c0ce
...@@ -90,77 +90,88 @@ ...@@ -90,77 +90,88 @@
<el-dialog class="pdDel" :title="title" :visible.sync="openDel" width="1300px" append-to-body @close="handleDialogClose"> <el-dialog class="pdDel" :title="title" :visible.sync="openDel" width="1300px" append-to-body @close="handleDialogClose">
<div class="top"> <div class="top">
<div class="oneButtion"> <div class="oneButtion">
<el-button <!-- <el-button-->
id="primary_del" <!-- id="primary_del"-->
:class="selectedButton === '无' ? 'button_rowBtn_action' : ''" <!-- :class="selectedButton === '无' ? 'button_rowBtn_action' : ''"-->
@click="handleButton('无')" <!-- @click="handleButton('无')"-->
> <!-- >-->
<div class="buttionText"> <!-- <div class="buttionText">-->
<span></span> <!-- <span>无</span>-->
<span style="color: red">({{ total0 }})</span> <!-- <span style="color: red">({{ total0 }})</span>-->
</div> <!-- </div>-->
</el-button> <!-- </el-button>-->
<el-button <!-- <el-button-->
id="primary_del" <!-- id="primary_del"-->
ref="buttonAAAA" <!-- ref="buttonAAAA"-->
:class="selectedButton === 'A' ? 'button_rowBtn_action' : ''" <!-- :class="selectedButton === 'A' ? 'button_rowBtn_action' : ''"-->
@click="handleButton('A')" <!-- @click="handleButton('A')"-->
> <!-- >-->
<div class="buttionText"> <!-- <div class="buttonText">-->
<span>A</span> <!-- <span>A</span>-->
<span style="color: red">({{ totalA }})</span> <!-- <span style="color: red">({{ totalA }})</span>-->
</div> <!-- </div>-->
</el-button> <!-- </el-button>-->
<el-button <!-- <el-button-->
id="primary_del" <!-- id="primary_del"-->
:class="selectedButton === 'B' ? 'button_rowBtn_action' : ''" <!-- :class="selectedButton === 'B' ? 'button_rowBtn_action' : ''"-->
@click="handleButton('B')" <!-- @click="handleButton('B')"-->
> <!-- >-->
<div class="buttionText"> <!-- <div class="buttionText">-->
<span>B</span> <!-- <span>B</span>-->
<span style="color: red">({{ totalB }})</span> <!-- <span style="color: red">({{ totalB }})</span>-->
</div> <!-- </div>-->
</el-button> <!-- </el-button>-->
<el-button <!-- <el-button-->
id="primary_del" <!-- id="primary_del"-->
:class="selectedButton === 'C' ? 'button_rowBtn_action' : ''" <!-- :class="selectedButton === 'C' ? 'button_rowBtn_action' : ''"-->
@click="handleButton('C')" <!-- @click="handleButton('C')"-->
> <!-- >-->
<div class="buttionText"> <!-- <div class="buttionText">-->
<span>C</span> <!-- <span>C</span>-->
<span style="color: red">({{ totalC }})</span> <!-- <span style="color: red">({{ totalC }})</span>-->
</div> <!-- </div>-->
</el-button> <!-- </el-button>-->
<el-button <!-- <el-button-->
id="primary_del" <!-- id="primary_del"-->
:class="selectedButton === 'D' ? 'button_rowBtn_action' : ''" <!-- :class="selectedButton === 'D' ? 'button_rowBtn_action' : ''"-->
@click="handleButton('D')" <!-- @click="handleButton('D')"-->
> <!-- >-->
<div class="buttionText"> <!-- <div class="buttionText">-->
<span>D</span> <!-- <span>D</span>-->
<span style="color: red">({{ totalD }})</span> <!-- <span style="color: red">({{ totalD }})</span>-->
</div> <!-- </div>-->
</el-button> <!-- </el-button>-->
<el-button <!-- <el-button-->
id="primary_del" <!-- id="primary_del"-->
:class="selectedButton === 'E' ? 'button_rowBtn_action' : ''" <!-- :class="selectedButton === 'E' ? 'button_rowBtn_action' : ''"-->
@click="handleButton('E')" <!-- @click="handleButton('E')"-->
> <!-- >-->
<div class="buttionText"> <!-- <div class="buttionText">-->
<span>E</span> <!-- <span>E</span>-->
<span style="color: red">({{ totalE }})</span> <!-- <span style="color: red">({{ totalE }})</span>-->
</div> <!-- </div>-->
</el-button> <!-- </el-button>-->
<el-button <!-- <el-button-->
id="primary_del" <!-- id="primary_del"-->
:class="selectedButton === 'F' ? 'button_rowBtn_action' : ''" <!-- :class="selectedButton === 'F' ? 'button_rowBtn_action' : ''"-->
@click="handleButton('F')" <!-- @click="handleButton('F')"-->
> <!-- >-->
<div class="buttionText"> <!-- <div class="buttionText">-->
<span>F</span> <!-- <span>F</span>-->
<span style="color: red">({{ totalF }})</span> <!-- <span style="color: red">({{ totalF }})</span>-->
</div> <!-- </div>-->
</el-button> <!-- </el-button>-->
<div class="button-container">
<el-button
v-for="item in palletList"
:key="item.dictValue"
:type="buttonLable(pallet) === item.dictLabel ? 'primary' : 'default'"
style="width: 60px;margin-bottom: 10px;margin-left: 10px"
@click="handleButtonNew(item.dictLabel)"
>
{{ item.dictLabel }}<span style="color: red">({{ totalPd[item.dictValue] }})</span>
</el-button>
</div>
</div> </div>
</div> </div>
<br> <br>
...@@ -233,6 +244,7 @@ export default { ...@@ -233,6 +244,7 @@ export default {
dialogVisible: false, dialogVisible: false,
pallet: '0', pallet: '0',
palletList: [], palletList: [],
totalPd: [],
listA: [], listA: [],
listB: [], listB: [],
listC: [], listC: [],
...@@ -343,76 +355,22 @@ export default { ...@@ -343,76 +355,22 @@ export default {
rows: this.queryPd.rows, rows: this.queryPd.rows,
pallet: '' pallet: ''
} }
const count = [0, 1, 2, 3, 4, 5, 6] for (let i = 0; i < this.palletList.length; i++) {
for (let i = 0; i < count.length; i++) { const item = this.palletList[i].dictValue
const item = count[i]
queryParams.pallet = item queryParams.pallet = item
await getDelList(queryParams).then(response => { await getDelList(queryParams).then(response => {
switch (item) { this.listZero.push(response.data.records)
case 0: this.totalPd[item] = Number(response.data.total)
this.listZero.push(response.data.records)
this.total0 = Number(response.data.total)
break
case 1:
this.listA.push(response.data.records)
this.totalA = Number(response.data.total)
break
case 2:
this.listB.push(response.data.records)
this.totalB = Number(response.data.total)
break
case 3:
this.listC.push(response.data.records)
this.totalC = Number(response.data.total)
break
case 4:
this.listD.push(response.data.records)
this.totalD = Number(response.data.total)
break
case 5:
this.listE.push(response.data.records)
this.totalE = Number(response.data.total)
break
case 6:
this.listF.push(response.data.records)
this.totalF = Number(response.data.total)
break
}
if (Number(response.data.total) > 0) { if (Number(response.data.total) > 0) {
if (!this.selectedButton) { if (!this.selectedButton) {
this.selectedButton = String(this.buttonLable(item)) this.selectedButton = String(this.buttonLable(item))
this.queryPdDel.PdDelList = response.data.records
} else if (this.selectedButton) { } else if (this.selectedButton) {
return this.selectedButton return this.selectedButton
} }
} }
}) })
} }
switch (this.selectedButton) {
case '无':
this.queryPdDel.PdDelList = this.listZero[0]
break
case 'A':
this.queryPdDel.PdDelList = this.listA[0]
break
case 'B':
this.queryPdDel.PdDelList = this.listB[0]
break
case 'C':
this.queryPdDel.PdDelList = this.listC[0]
break
case 'D':
this.queryPdDel.PdDelList = this.listD[0]
break
case 'E':
this.queryPdDel.PdDelList = this.listE[0]
break
case 'F':
this.queryPdDel.PdDelList = this.listF[0]
break
default:
this.queryPdDel.PdDelList = []
break
}
this.title = '删除' this.title = '删除'
this.openDel = true this.openDel = true
}, },
...@@ -440,8 +398,7 @@ export default { ...@@ -440,8 +398,7 @@ export default {
}) })
}) })
}, },
handleButton(buttonName) { handleButtonNew(buttonName) {
console.log('buttonName', buttonName)
this.selectedButton = buttonName this.selectedButton = buttonName
const queryParams = { const queryParams = {
businessId: this.userNew, businessId: this.userNew,
...@@ -449,27 +406,42 @@ export default { ...@@ -449,27 +406,42 @@ export default {
rows: this.queryPdDel.rows, rows: this.queryPdDel.rows,
pallet: '' pallet: ''
} }
queryParams.pallet = this.buttonValue(buttonName) queryParams.pallet = this.buttonValue(this.selectedButton)
getDelList(queryParams).then(response => { getDelList(queryParams).then(response => {
this.queryPdDel.PdDelList = response.data.records this.queryPdDel.PdDelList = response.data.records
this.total = response.data.total this.totalPd[queryParams.pallet] = response.data.total
if (queryParams.pallet === '0') {
this.total0 = response.data.total
} else if (queryParams.pallet === '1') {
this.totalA = response.data.total
} else if (queryParams.pallet === '2') {
this.totalB = response.data.total
} else if (queryParams.pallet === '3') {
this.totalC = response.data.total
} else if (queryParams.pallet === '4') {
this.totalD = response.data.total
} else if (queryParams.pallet === '5') {
this.totalE = response.data.total
} else if (queryParams.pallet === '6') {
this.totalF = response.data.total
}
}) })
}, },
// handleButton1(buttonName) {
// console.log('buttonName', buttonName)
// this.selectedButton = buttonName
// const queryParams = {
// businessId: this.userNew,
// page: this.queryPdDel.page,
// rows: this.queryPdDel.rows,
// pallet: ''
// }
// queryParams.pallet = this.buttonValue(buttonName)
// getDelList(queryParams).then(response => {
// this.queryPdDel.PdDelList = response.data.records
// this.total = response.data.total
// if (queryParams.pallet === '0') {
// this.total0 = response.data.total
// } else if (queryParams.pallet === '1') {
// this.totalA = response.data.total
// } else if (queryParams.pallet === '2') {
// this.totalB = response.data.total
// } else if (queryParams.pallet === '3') {
// this.totalC = response.data.total
// } else if (queryParams.pallet === '4') {
// this.totalD = response.data.total
// } else if (queryParams.pallet === '5') {
// this.totalE = response.data.total
// } else if (queryParams.pallet === '6') {
// this.totalF = response.data.total
// }
// })
// },
getList() { getList() {
getInfo().then(response => { getInfo().then(response => {
const data = { const data = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment