|
@@ -134,13 +134,19 @@ const saveRowClick = async () => {
|
|
}
|
|
}
|
|
|
|
|
|
//删除数据
|
|
//删除数据
|
|
-const delRowClick = ({ citeStatus }, index) => {
|
|
|
|
|
|
+const delRowClick = ({ id, citeStatus }, index) => {
|
|
if (citeStatus === 1) {
|
|
if (citeStatus === 1) {
|
|
window?.$message?.warning('当前数据已被计量,不允许删除')
|
|
window?.$message?.warning('当前数据已被计量,不允许删除')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
//删除弹窗
|
|
//删除弹窗
|
|
HcDelMsg(async (resolve) => {
|
|
HcDelMsg(async (resolve) => {
|
|
|
|
+ const { error, code } = await mainApi.deleteById(id)
|
|
|
|
+ if (error && code !== 200) {
|
|
|
|
+ resolve() //关闭弹窗的回调
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ window?.$message?.success('操作成功')
|
|
const rows = tableData.value
|
|
const rows = tableData.value
|
|
rows.splice(index, 1)
|
|
rows.splice(index, 1)
|
|
isAddModal.value = true
|
|
isAddModal.value = true
|