Commit 478263cb by cwq0219

带货

1 parent bd50bef2
......@@ -12,4 +12,15 @@ const getListApi = params => {
})
}
export default { getListApi }
const takeGookApi = params => {
params.method = `${defaultPath}batchTake`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getListApi, takeGookApi }
......@@ -131,9 +131,42 @@ export default {
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
handleSingleTakeGood(row) {
this.secondConfirm('带货', '是否确认带货?', 'takeGood', 'takeGookApi', { takeGoodsIdList: [row.goodsId] })
},
handleTakeGood() {
var selectedList = this.$refs.takeGoodRef.mutiSelectArr[this.tableParams.mutiSelectName]
console.log(selectedList)
if (!selectedList.length) {
this.$message({
message: '请勾选要带货的商品',
type: 'error'
})
return true
}
this.secondConfirm('带货', '是否确认带货?', 'takeGood', 'takeGookApi', { takeGoodsIdList: selectedList.map(item => item.goodsId) })
},
handleDetail(row) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!