|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <hc-new-dialog v-model="isShow" widths="90%" :is-table="isTable" :padding="false" title="合同计量单元修改" :loading="addNodeLoading" @save="modalSave">
|
|
|
+ <hc-new-dialog v-model="isShow" widths="90%" :is-table="isTable" :padding="false" title="合同计量单元修改" :loading="addNodeLoading" @save="modalSave" @close="closeDialog">
|
|
|
<hc-body scrollbar :contents="!isTable">
|
|
|
<el-form ref="formRef" label-position="left" label-width="auto" :model="formModel" :rules="formRules">
|
|
|
<el-row :gutter="20">
|
|
@@ -95,7 +95,7 @@
|
|
|
<hc-table-input v-model="row.poseNum" />
|
|
|
</template>
|
|
|
<template #action="{ row, index }">
|
|
|
- <el-link type="danger" @click="delRow(index)">删除</el-link>
|
|
|
+ <el-link type="danger" @click="delRow(row, index)">删除</el-link>
|
|
|
</template>
|
|
|
</hc-table>
|
|
|
</div>
|
|
@@ -114,6 +114,7 @@ import unitApi from '~api/project/debit/contract/unit.js'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import { getDictionary } from '~api/other'
|
|
|
import { getArrValue } from 'js-fast-way'
|
|
|
+import { delMessageV2 } from '~com/message/index.js'
|
|
|
|
|
|
const props = defineProps({
|
|
|
ids: {
|
|
@@ -130,9 +131,7 @@ const props = defineProps({
|
|
|
})
|
|
|
//事件
|
|
|
const emit = defineEmits(['finish', 'close'])
|
|
|
-const useAppState = useAppStore()
|
|
|
-const projectId = ref(useAppState.getProjectId || '')
|
|
|
-const contractId = ref(useAppState.getContractId || '')
|
|
|
+
|
|
|
//双向绑定
|
|
|
// eslint-disable-next-line no-undef
|
|
|
const isShow = defineModel('modelValue', {
|
|
@@ -233,7 +232,9 @@ const modalSave = async () => {
|
|
|
}
|
|
|
emit('finish')
|
|
|
}
|
|
|
-
|
|
|
+const closeDialog = ()=>{
|
|
|
+ emit('close')
|
|
|
+}
|
|
|
const addCheckListShow = ref(false)
|
|
|
const addCheckFinish = (val)=>{
|
|
|
addCheckListShow.value = false
|
|
@@ -241,7 +242,27 @@ const addCheckFinish = (val)=>{
|
|
|
tableData.value.push(ele)
|
|
|
})
|
|
|
}
|
|
|
-const delRow = (index)=>{
|
|
|
- tableData.value.splice(index, 1)
|
|
|
+const delRow = async (row, index)=>{
|
|
|
+ delMessageV2(async (action, instance, done) => {
|
|
|
+ if (action === 'confirm') {
|
|
|
+ instance.confirmButtonLoading = true
|
|
|
+ removeCon(row.id, index)
|
|
|
+ instance.confirmButtonLoading = false
|
|
|
+ done()
|
|
|
+ } else {
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+const removeCon = async (id, index) => {
|
|
|
+ const { error, code } = await unitApi.removeInfo({
|
|
|
+ formIds: id,
|
|
|
+ meterId:ids.value,
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window?.$message?.success('删除成功')
|
|
|
+ tableData.value.splice(index, 1)
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|