Browse Source

Merge pull request '包装新增模板ID显示,关闭包装后默认选中第一个' (#66) from feature_supplier into develop

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_GAAS_GFrame_WEBFRONT/pulls/66
Reviewed-by: Liwei <wei.li@le-it.com.cn>
pull/68/head
Liwei 3 years ago
parent
commit
33685666d3
1 changed files with 40 additions and 13 deletions
  1. +40
    -13
      src/views/quality/pkg.vue

+ 40
- 13
src/views/quality/pkg.vue View File

@ -16,7 +16,7 @@
@click="selectCurrentClick(item, index)"
class="pkg-li"
:class="[activePkg === item.PackOrderId ? 'active-pck' : 'unactive-pkg']">
{{item.PackOrderId}}
{{item.PackOrderId}}&nbsp;&nbsp;&nbsp;&nbsp;{{item['LOG_PackOrder-PackTemplateId']}}
</li>
</ul>
</div>
@ -145,14 +145,14 @@ export default {
element.PackOrderId = element['LOG_PackOrder-PackOrderId']
})
}
this.pkgs = res.data
this.pkgs = res.data || []
this.loading = false
})
},
choosePkg(PackOrderId) { //
this.activePkg = PackOrderId
this.actPkgObj = this.pkgs.filter((pkg) => pkg.PackOrderId == PackOrderId)[0] || null
this.packorderitemlst()
this.actPkgObj = this.pkgs.filter((pkg) => pkg.PackOrderId == PackOrderId)[0] || {}
this.packorderitemlst() //
this.$nextTick(() => {
if (this.$refs[`${PackOrderId}`])
this.$refs[`${PackOrderId}`][0].scrollIntoView()
@ -161,8 +161,15 @@ export default {
packorderitemlst() { //
this.tableLoading = true
api.packorderitemlst(this.activePkg).then((res) => {
this.tableData = res.data
this.tableData = res.data || []
this.tableLoading = false
// let newPkgsArray = this.tableData.filter((el) => el['LOG_PackOrderItemlst-Status'] !== 80)
// if (newPkgsArray.length === 0) {
// this.activePkg = ''
// this.actPkgObj = {}
// this.tableData = []
// this.getPackorder()
// }
})
},
checkCodeInPkgs(code) { //
@ -180,7 +187,11 @@ export default {
}
api.checkpackorderitem(params).then((res) => {
if (res.code === 200) {
this.packorderitemlst()
if (res.data == 'close') {
this.defaultSelectOne()
} else {
this.packorderitemlst() //
}
}
})
},
@ -223,17 +234,33 @@ export default {
}
this.pkgNum = '' //
},
//
defaultSelectOne() {
api.getPackorder().then((res) => {
if (res.data && res.data.length) {
res.data.forEach((element) => {
element.PackOrderId = element['LOG_PackOrder-PackOrderId']
})
}
this.pkgs = res.data || []
if (this.pkgs.length > 0) {
this.activePkg = this.pkgs[0]['LOG_PackOrder-PackOrderId']
this.actPkgObj = this.pkgs[0] || {}
this.packorderitemlst()
} else {
this.activePkg = ''
this.actPkgObj = {}
this.tableData = []
}
})
},
closePkg() { //
let params = {
packOrderId: this.activePkg
}
api.closePkg(params).then((res) => {
if (res.code == 200) {
this.pkgs = this.pkgs.filter((pkg) => pkg.PackOrderId != this.activePkg)
this.msgSuccess(`关闭包装${this.activePkg}`)
this.activePkg = ''
this.actPkgObj = null
this.tableData = []
this.defaultSelectOne()
}
})
},
@ -326,7 +353,7 @@ export default {
width: 100%;
.pkg-list-left { //
padding: 10px;
width: 20%;
width: 25%;
height: calc(65vh);
.pkg-list-info {
background: #fff;
@ -386,7 +413,7 @@ export default {
}
}
.pkg-list-right { //
width: 80%;
width: 75%;
margin-top: 10px;
height: calc(65vh - 10px);
background: #fff;


Loading…
Cancel
Save