Commit 7bdc4c54 authored by 小费同学阿's avatar 小费同学阿 💬

Merge remote-tracking branch 'origin/template_pda_vue' into template_pda_vue

parents 4a86b426 2a583832
...@@ -165,6 +165,7 @@ ...@@ -165,6 +165,7 @@
<script> <script>
import { getInfo } from '@/api/login' import { getInfo } from '@/api/login'
import { delPd, getDelList, getDelListCount, getDicts, getPdList, getViewList, updatePd } from '@/api/materialInventory' import { delPd, getDelList, getDelListCount, getDicts, getPdList, getViewList, updatePd } from '@/api/materialInventory'
import { playAudio, successAudio } from '@/utils/common'
export default { export default {
name: 'Inventory', name: 'Inventory',
...@@ -332,9 +333,16 @@ export default { ...@@ -332,9 +333,16 @@ export default {
} }
queryParams.pallet = this.buttonValue(this.selectedButton) queryParams.pallet = this.buttonValue(this.selectedButton)
getDelList(queryParams).then(response => { getDelList(queryParams).then(response => {
this.queryPdDel.PdDelList = response.data.records if (response.data.total === 0) {
this.totalPd[queryParams.pallet] = response.data.total this.$message({
this.total = response.data.total message: '当前无记录',
type: 'error'
})
} else {
this.queryPdDel.PdDelList = response.data.records
this.totalPd[queryParams.pallet] = response.data.total
this.total = response.data.total
}
}) })
}, },
getList() { getList() {
...@@ -375,7 +383,14 @@ export default { ...@@ -375,7 +383,14 @@ export default {
this.valuePd = 'bacc-red' this.valuePd = 'bacc-red'
this.queryForm.value = '' this.queryForm.value = ''
updatePd(obj).then(res => { updatePd(obj).then(res => {
this.valuePd = res.code === 200 ? 'bacc-green' : 'bacc-red' // this.valuePd = res.code === 200 ? 'bacc-green' : 'bacc-red'
if (res.code === 200) {
successAudio(true)
this.valuePd = 'bacc-green'
} else {
playAudio(true)
this.valuePd = 'bacc-red'
}
this.getList() this.getList()
}) })
this.move() this.move()
...@@ -395,16 +410,20 @@ export default { ...@@ -395,16 +410,20 @@ export default {
type: 'warning' type: 'warning'
}).then(function() { }).then(function() {
return delPd(queryParams) return delPd(queryParams)
}).then(() => { }).then((res) => {
this.$message({ if (res.code === 500) {
message: '删除成功', return
type: 'success' } else {
}) this.$message({
this.queryPdDel.PdDelList = [] message: '删除成功',
this.openDel = false type: 'success'
this.getList() })
this.totalPd = [] this.queryPdDel.PdDelList = []
this.move() this.openDel = false
this.getList()
this.totalPd = []
this.move()
}
}) })
}, },
rowClassName({ row }) { rowClassName({ row }) {
......
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