Browse Source

更新依赖和中间支付申请

ZaiZai 1 year ago
parent
commit
f80be0d790

+ 7 - 4
src/views/debit-pay/admin/components/middlepay/addModal.vue

@@ -1,7 +1,7 @@
 <template>
     <hc-new-dialog is-table widths="95%" :show="isShow" title="中间计量新增" @save="addModalSave" @close="addModalClose">
         <div class="relative h-full flex">
-            <div :id="`hc_tree_card_${uuid}`" class="hc_tree_card_border relative">
+            <div v-if="dataType === 'add'" :id="`hc_tree_card_${uuid}`" class="hc_tree_card_border relative">
                 <hc-body scrollbar padding="0px">
                     <hc-lazy-tree :h-props="treeProps" tree-key="id" :auto-expand-keys="treeAutoExpandKeys" @load="treeLoadNode" @nodeTap="treeNodeTap" />
                 </hc-body>
@@ -210,14 +210,16 @@ watch(() => [
     pid.value = projectId
     cid.value = contractId
     period_id.value = periodId
-    setBasePeriodForm(periodId)
+    if (type === 'add' ) {
+        setBasePeriodForm(periodId)
+    }
 }, { deep: true })
 
 //监听
 watch(isShow, (val) => {
-    if (val) {
-        setSplitRef()
+    if (val && dataType.value === 'add' ) {
         setBasePeriodForm(period_id.value)
+        setSplitRef()
     }
 })
 
@@ -427,6 +429,7 @@ const addModalSave = async () => {
 //关闭弹窗
 const addModalClose = () => {
     isShow.value = false
+    baseForm.value = { fileList: [] }
     emit('close')
 }
 </script>

+ 14 - 4
src/views/debit-pay/admin/middlepay.vue

@@ -45,7 +45,7 @@
             </hc-new-card>
         </div>
         <!-- 中间计量新增 -->
-        <HcAddModal v-model="addModalShow" :project-id="projectId" :contract-id="contractId" :type="isAddModalType" :all-periods="key1Data" :period-id="searchForm.contractPeriodId" @finish="addModalFinish" />
+        <HcAddModal v-model="addModalShow" :ids="addModalIds" :project-id="projectId" :contract-id="contractId" :type="isAddModalType" :all-periods="key1Data" :period-id="searchForm.contractPeriodId" @finish="addModalFinish" />
 
         <!-- 清单明细 -->
         <HcDetailsModal v-model="detailsModalShow" />
@@ -215,19 +215,29 @@ const tableCheckChange = () => {
 const addModalShow = ref(false)
 const isAddModalType = ref('add')
 const addModalClick = () => {
+    addModalIds.value = ''
     isAddModalType.value = 'add'
     addModalShow.value = true
 }
 
 //修改
+const addModalIds = ref('')
 const rowEditClick = (row) => {
-
+    addModalIds.value = row.id
+    isAddModalType.value = 'edit'
+    addModalShow.value = true
 }
 
 //删除
 const rowDelClick = (row) => {
-    delMessage(() => {
-        console.log('删除')
+    delMessage(async () => {
+        const { code, msg } = await mainApi.remove({ ids: row.id })
+        if (code === 200) {
+            window.$message.success('删除成功')
+            getTableData().then()
+        } else {
+            window.$message.error(msg ?? '删除失败')
+        }
     })
 }