|
|
|
@ -108,6 +108,14 @@
|
|
|
|
|
|
|
|
|
|
<el-text @click="() => handleDownAllocation(false, slotProps.scope)">一键下架</el-text> |
|
|
|
|
</template> |
|
|
|
|
<template v-if="slotProps.scope.column.label == '是否自动上架'"> |
|
|
|
|
<el-switch |
|
|
|
|
@click="handleMakeCargo(slotProps.scope.row)" |
|
|
|
|
v-model="slotProps.scope.row.isDefault" |
|
|
|
|
:active-value="1" |
|
|
|
|
:inactive-value="0" |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</tablecmt> |
|
|
|
|
|
|
|
|
@ -181,6 +189,7 @@ import {
|
|
|
|
|
disable, |
|
|
|
|
enable, |
|
|
|
|
getNode, |
|
|
|
|
$_updateDefault, |
|
|
|
|
downAllocation, |
|
|
|
|
} from '@/api/basicdata/basicdataGoodsAllocation'; |
|
|
|
|
|
|
|
|
@ -559,6 +568,37 @@ const handleView = ({ row }) => {
|
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
const handleMakeCargo = async row => { |
|
|
|
|
row.isDefault = !row.isDefault ? 1 : 0; |
|
|
|
|
ElMessageBox.confirm(`是否确认${row.isDefault ? '关闭' : '开启'}{操作?`, '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
.then(async () => { |
|
|
|
|
try { |
|
|
|
|
details.loadingObj.list = true; |
|
|
|
|
let data = { |
|
|
|
|
id: row.id, |
|
|
|
|
isDefault: !row.isDefault ? 1 : 0, |
|
|
|
|
}; |
|
|
|
|
await $_updateDefault(data).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
ElMessage.success(res.data.msg); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e); |
|
|
|
|
} finally { |
|
|
|
|
details.loadingObj.list = false; |
|
|
|
|
onLoad(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
console.log(row,'row'); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|