Commit f4d03d85 by zhangquan

去掉可选链

1 parent c6334eea
......@@ -195,10 +195,10 @@ export default {
equityCouponRequestList
}
this.$apis.goodsConponApi.createCoupons(params).then(res => {
if (res?.length === 0) {
if (res && res.length === 0) {
this.$message.success('创建成功')
this.$router.push({ path: '/goodsConpon/index' })
} else if (res?.length > 0) {
} else if (res && res.length > 0) {
this.errorConponList = selectedGoodsList.filter(item => res.indexOf(item.id) > -1)
this.errorVisible = true
}
......
......@@ -201,12 +201,12 @@ export default {
})
},
getBeforeChangeList(type = 1) {
let list = this.$refs?.tableRef?.mutiSelectArr?.[this.tableParams?.mutiSelectName] || []
let list = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName] || []
this[type == 2 ? 'conponList' : 'directChargeList'] = [...list]
},
onOk() {
let selectedList = this.curType == 2 ? this.conponList : this.directChargeList
let list = this.$refs?.tableRef?.mutiSelectArr?.[this.tableParams?.mutiSelectName] || []
let list = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName] || []
list = [...selectedList, ...list]
for (let i = 0; i < this.selectedGoodsList.length; i++) {
let idx = list.findIndex(item => item.id == this.selectedGoodsList[i].id)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!