Parcourir la source

项目支付项接口调用

duy il y a 1 an
Parent
commit
dc063c7dfa

+ 4 - 1
src/api/modules/project/debit/contract.js → src/api/modules/project/debit/project/contract.js

@@ -1,4 +1,7 @@
-import { HcApi } from '../../../request/index'
+import { HcApi } from '../../../../request/index'
+
+// 合同工程清单
+
 //获取合同清单树
 export const getFormTree = (form = {}, msg = true) => HcApi({
     url: '/api/blade-meter/contractInventoryForm/getFormTree',

+ 78 - 0
src/api/modules/project/debit/project/pay.js

@@ -0,0 +1,78 @@
+import { HcApi } from '../../../../request/index'
+
+//  项目支付项
+export default {
+    //系统中期支付项列表(ype=0(未被引用),type=1(已引用),type=空(全部))
+   async getSyslist(form, msg = true) {
+    return HcApi({
+        url: '/api/blade-meter/mid/pay/item/system/list',
+            method: 'post',
+            params: form,
+        }, msg)
+   },
+    //项目中期支付项引用系统级数据
+    async referenced(form, msg = true) {
+        return HcApi({
+            url: '/api/blade-meter/mid/pay/item/project/referenced',
+            method: 'post',
+            params: form,
+        }, msg)
+     },
+         //项目中期支付项分页
+    async getProListPage(form, msg = true) {
+        return HcApi({
+            url: '/api/blade-meter/mid/pay/item/project/page',
+            method: 'post',
+            data: form,
+        }, msg)
+     },
+     //项目中期支付项详情
+    async getProDetail(form, msg = true) {
+        return HcApi({
+            url: '/api//blade-meter/mid/pay/item/project/detail',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
+    //项目中期支付项修改
+    async updateProList(form, msg = true) {
+        return HcApi({
+            url: '/api/blade-meter/mid/pay/item/project/update',
+            method: 'post',
+            data: form,
+        }, msg)
+     },
+     //项目中期支付项删除
+    async removeProList(form, msg = true) {
+        return HcApi({
+            url: '/api/blade-meter/mid/pay/item/project/remove',
+            method: 'get',
+            params: form,
+        }, msg)
+    },
+    //项目中期支付项列表
+    async getProPayList(form, msg = true) {
+        return HcApi({
+                url: '/api/blade-meter/mid/pay/item/project/list',
+                method: 'post',
+                params: form,
+            }, msg)
+    },
+     //中期支付项添加汇总项
+     async addCollect(form, msg = true) {
+        return HcApi({
+                url: '/api/blade-meter/mid/pay/item/bind/submit',
+                method: 'post',
+                params: form,
+            }, msg)
+    },
+    //中期支付项删除汇总项
+    async removeCollect(form, msg = true) {
+        return HcApi({
+                url: '/api/blade-meter/mid/pay/item/bind/remove',
+                method: 'post',
+                params: form,
+            }, msg)
+    },
+        
+}

+ 2 - 2
src/api/modules/project/debit/unit.js → src/api/modules/project/debit/project/unit.js

@@ -1,6 +1,6 @@
-import { HcApi } from '../../../request/index'
+import { HcApi } from '../../../../request/index'
 
- 
+//  项目计量单元
 export default {
     //懒加载系统树
     async lazyTree(form, msg = true) {

+ 1 - 1
src/views/project/debit/contract/check-list.vue

@@ -282,7 +282,7 @@ import { getHeader } from 'hc-vue3-ui'
 import { useAppStore } from '~src/store'
 import infoTable from './components/check-list/info-table.vue'
 import infoTable1 from './components/check-list/info-table1.vue'
-import { addNode, deleteNode, getDetail, getFormTree, getImportTemplate, lockNode, sortForm, updateForm } from '~api/project/debit/contract.js'
+import { addNode, deleteNode, getDetail, getFormTree, getImportTemplate, lockNode, sortForm, updateForm } from '~api/project/debit//project/contract.js'
 import { getDictionary } from '~api/other'
 import { getStoreValue, setStoreValue } from '~src/utils/storage'
 import { delMessageV2 } from '~com/message/index.js'

+ 49 - 12
src/views/project/debit/project/components/pay/info-table.vue

@@ -2,43 +2,80 @@
     <hc-info-table>
         <tr>
             <hc-info-table-td center is-title>支付项编号:</hc-info-table-td>
-            <hc-info-table-td width="120px">100章</hc-info-table-td>
+            <hc-info-table-td width="120px">{{ formModel?.payNumber }}</hc-info-table-td>
             <hc-info-table-td center is-title>支付项名称:</hc-info-table-td>
-            <hc-info-table-td width="120px">100章</hc-info-table-td>
+            <hc-info-table-td width="120px">{{ formModel?.payName }}</hc-info-table-td>
         </tr>
         <tr>
             <hc-info-table-td center is-title>支付项类型:</hc-info-table-td>
-            <hc-info-table-td width="120px">100章</hc-info-table-td>
+            <hc-info-table-td width="120px">{{ formModel?.payType }}</hc-info-table-td>
             <hc-info-table-td center is-title>是否为扣款项:</hc-info-table-td>
-            <hc-info-table-td width="120px">否</hc-info-table-td>
+            <hc-info-table-td width="120px">{{ formModel?.isDeduct === 1 ? '是' : '' }}</hc-info-table-td>
         </tr>
         <tr>
             <hc-info-table-td center is-title>是否合计项:</hc-info-table-td>
-            <hc-info-table-td width="120px">否</hc-info-table-td>
+            <hc-info-table-td width="120px">{{ formModel?.isTotalTerms === 1 ? '是' : '' }}</hc-info-table-td>
             <hc-info-table-td center is-title>是否显示百分比:</hc-info-table-td>
-            <hc-info-table-td width="120px">是</hc-info-table-td>
+            <hc-info-table-td width="120px">{{ formModel?.isShowPercent === 1 ? '' : '否' }}</hc-info-table-td>
         </tr>
         <tr>
             <hc-info-table-td center is-title>是否手动输入:</hc-info-table-td>
-            <hc-info-table-td width="120px">否</hc-info-table-td>
+            <hc-info-table-td width="120px">{{ formModel?.isManualInput === 1 ? '是' : '' }}</hc-info-table-td>
             <hc-info-table-td center is-title>排序号:</hc-info-table-td>
-            <hc-info-table-td width="120px">1</hc-info-table-td>
+            <hc-info-table-td width="120px">{{ formModel?.sort }}</hc-info-table-td>
         </tr>
         <tr>
             <hc-info-table-td center is-title>合同计算公式名称:</hc-info-table-td>
-            <hc-info-table-td width="auto" colspan="3">章清单合同原总金额</hc-info-table-td>
+            <hc-info-table-td width="auto" colspan="3">{{ formModel?.contractFormulaIds }}</hc-info-table-td>
         </tr>
         <tr>
             <hc-info-table-td center is-title>变更计算公式名称:</hc-info-table-td>
-            <hc-info-table-td width="auto" colspan="3">章清单变更金额</hc-info-table-td>
+            <hc-info-table-td width="auto" colspan="3">{{ formModel?.updateFormulaIds }}</hc-info-table-td>
         </tr>
         <tr>
             <hc-info-table-td center is-title>本期计算公式名称:</hc-info-table-td>
-            <hc-info-table-td width="auto" colspan="3">章清单本期完成金额</hc-info-table-td>
+            <hc-info-table-td width="auto" colspan="3">{{ formModel?.currentFormulaIds }}</hc-info-table-td>
         </tr>
         <tr>
             <hc-info-table-td center is-title>备注:</hc-info-table-td>
-            <hc-info-table-td width="auto" colspan="3">-</hc-info-table-td>
+            <hc-info-table-td width="auto" colspan="3">{{ formModel?.remarks }}</hc-info-table-td>
         </tr>
     </hc-info-table>
 </template>
+
+<script setup>
+import { ref, watch } from 'vue'
+import payApi from '~api/project/debit/project/pay.js'
+import { getObjValue } from 'js-fast-way'
+
+const props = defineProps({
+    ids: {
+        type: [String, Number],
+        default: '',
+    },
+})
+//事件
+
+const formModel = ref({})
+//获取节点详情
+const getDetail = async (id)=>{
+    const { error, code, data } = await payApi.getProDetail({
+       id,
+    })
+    if (!error && code === 200) {
+        formModel.value = getObjValue(data)
+   
+    } else {
+        formModel.value = {}
+    }
+}
+//监听
+watch(() => [
+    props.ids,
+], ([ids]) => {
+    if (ids.length > 0) {
+        getDetail(ids)
+    }
+  
+}, { immediate: true })
+</script>

+ 45 - 19
src/views/project/debit/project/components/pay/row-data.vue

@@ -1,63 +1,63 @@
 <template>
-    <hc-new-dialog v-model="isShow" is-table widths="666px" title="修改项目支付项" @save="modalSave">
+    <hc-new-dialog v-model="isShow" is-table widths="666px" title="修改项目支付项" :loading="saveLoading" @save="modalSave">
         <el-scrollbar class="hc-dialog-scrollbar">
             <el-form ref="formRef" class="p-2" label-position="left" label-width="auto" :model="formModel" :rules="formRules">
                 <el-form-item label="支付项编号:">
-                    <el-input v-model="formModel.key1" />
+                    <el-input v-model="formModel.payNumber" />
                 </el-form-item>
                 <el-form-item label="支付项名称:">
-                    <el-input v-model="formModel.key2" />
+                    <el-input v-model="formModel.payName" />
                 </el-form-item>
                 <el-form-item label="支付项类型:">
-                    <el-select v-model="formModel.key3" block>
+                    <el-select v-model="formModel.payType" block>
                         <el-option label="xx项" :value="1" />
                     </el-select>
                 </el-form-item>
                 <el-form-item class="nowrap" label="合同计算公式:">
-                    <el-input v-model="formModel.key4" class="flex-1" disabled />
+                    <el-input v-model="formModel.contractFormulaIds" class="flex-1" disabled />
                     <el-link type="primary" class="ml-2 line-height-normal" @click="formulaClick">添加公式</el-link>
                     <el-link type="danger" class="ml-2 line-height-normal">删除公式</el-link>
                 </el-form-item>
                 <el-form-item class="nowrap" label="变更计算公式:">
-                    <el-input v-model="formModel.key5" disabled class="flex-1" />
+                    <el-input v-model="formModel.updateFormulaIds" disabled class="flex-1" />
                     <el-link type="primary" class="ml-2 line-height-normal">添加公式</el-link>
                     <el-link type="danger" class="ml-2 line-height-normal">删除公式</el-link>
                 </el-form-item>
                 <el-form-item class="nowrap" label="本期计算公式:">
-                    <el-input v-model="formModel.key6" disabled class="flex-1" />
+                    <el-input v-model="formModel.currentFormulaIds" disabled class="flex-1" />
                     <el-link type="primary" class="ml-2 line-height-normal">添加公式</el-link>
                     <el-link type="danger" class="ml-2 line-height-normal">删除公式</el-link>
                 </el-form-item>
                 <el-form-item label="是否为扣款项:">
-                    <el-select v-model="formModel.key7" block>
+                    <el-select v-model="formModel.isDeduct" block>
                         <el-option label="xx项" :value="1" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="是否加粗:">
-                    <el-select v-model="formModel.key8" block>
+                    <el-select v-model="formModel.isBoldText" block>
                         <el-option label="xx项" :value="1" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="是否手动输入:">
-                    <el-select v-model="formModel.key9" block>
+                    <el-select v-model="formModel.isManualInput" block>
                         <el-option label="xx项" :value="1" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="是否显示百分比:">
-                    <el-select v-model="formModel.key10" block>
+                    <el-select v-model="formModel.isShowPercent" block>
                         <el-option label="xx项" :value="1" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="支付项适用类型:">
-                    <el-select v-model="formModel.key11" block>
+                    <el-select v-model="formModel.payApplicableType" block>
                         <el-option label="xx项" :value="1" />
                     </el-select>
                 </el-form-item>
                 <el-form-item label="排序号:">
-                    <el-input v-model="formModel.key12" />
+                    <el-input v-model="formModel.sort" />
                 </el-form-item>
                 <el-form-item label="备注:">
-                    <el-input v-model="formModel.key13" :autosize="{ minRows: 4, maxRows: 8 }" type="textarea" />
+                    <el-input v-model="formModel.remarks" :autosize="{ minRows: 4, maxRows: 8 }" type="textarea" />
                 </el-form-item>
             </el-form>
         </el-scrollbar>
@@ -68,28 +68,43 @@
 <script setup>
 import { ref, watch } from 'vue'
 import HcFormula from './formula.vue'
-
+import payApi from '~api/project/debit/project/pay.js'
+import { getObjValue } from 'js-fast-way'
+import { useAppStore } from '~src/store'
 const props = defineProps({
     ids: {
         type: [String, Number],
         default: '',
     },
 })
-
 //事件
 const emit = defineEmits(['finish', 'close'])
+const useAppState = useAppStore()
+const projectId = ref(useAppState.getProjectId)
 
 //双向绑定
 // eslint-disable-next-line no-undef
 const isShow = defineModel('modelValue', {
     default: false,
 })
-
+//获取节点详情
+const getDetail = async (id)=>{
+    const { error, code, data } = await payApi.getProDetail({
+       id,
+    })
+    if (!error && code === 200) {
+        formModel.value = getObjValue(data)
+   
+    } else {
+        formModel.value = {}
+    }
+}
 //监听
 watch(() => [
     props.ids,
 ], ([ids]) => {
     console.log('ids', ids)
+    getDetail(ids)
 }, { immediate: true })
 
 //监听
@@ -103,9 +118,20 @@ watch(isShow, (val) => {
 const formRef = ref(null)
 const formModel = ref({ })
 const formRules = ref({})
-
-const modalSave = () => {
+const saveLoading = ref(false)
+const modalSave = async () => {
     emit('finish')
+    saveLoading.value = true
+    const { error, code, msg } = await payApi.updateProList({
+          ...formModel.value,
+       
+        })
+        //判断状态
+        saveLoading.value = false
+        if (!error && code === 200) {
+            window?.$message?.success(msg)
+         
+        }
 }
 
 //公式

+ 55 - 17
src/views/project/debit/project/components/pay/system-pay.vue

@@ -1,26 +1,35 @@
 <template>
-    <hc-new-dialog v-model="isShow" is-table widths="1200px" title="引用系统支付项" @save="modalSave">
+    <hc-new-dialog v-model="isShow" is-table widths="1200px" title="引用系统支付项" :loading="saveLoading" @save="modalSave">
         <hc-table
             :column="tableColumn" :datas="tableData" :loading="tableLoading"
             is-new :check-style="{ width: 29 }" :index-style="{ width: 60 }"
             is-check @selection-change="tableCheckChange"
-        />
+        >
+            <template #isDeduct="{ row }">
+                <span>{{ row?.isDeduct === 1 ? '是' : '否' }}</span>
+            </template>
+            <template #isTotalTerms="{ row }">
+                <span>{{ row?.isTotalTerms === 1 ? '是' : '否' }}</span>
+            </template>
+        </hc-table>
     </hc-new-dialog>
 </template>
 
 <script setup>
 import { ref, watch } from 'vue'
-
+import payApi from '~api/project/debit/project/pay.js'
+import { arrToId, getArrValue } from 'js-fast-way'
+import { useAppStore } from '~src/store'
 const props = defineProps({
     ids: {
         type: [String, Number],
         default: '',
     },
 })
-
 //事件
 const emit = defineEmits(['finish', 'close'])
-
+const useAppState = useAppStore()
+const projectId = ref(useAppState.getProjectId)
 //双向绑定
 // eslint-disable-next-line no-undef
 const isShow = defineModel('modelValue', {
@@ -38,27 +47,56 @@ watch(() => [
 watch(isShow, (val) => {
     if (val) {
         console.log('处理数据')
+        getTableData()
     }
 })
 //表格数据
 const tableLoading = ref(false)
 const tableColumn = [
-    { key: 'key1', name: '支付项编号' },
-    { key: 'key2', name: '支付项名称' },
-    { key: 'key3', name: '支付项类型' },
-    { key: 'key4', name: '是否为扣款项' },
-    { key: 'key5', name: '是否合计项' },
-    { key: 'key5', name: '适用类型' },
+    { key: 'payNumber', name: '支付项编号' },
+    { key: 'payName', name: '支付项名称' },
+    { key: 'payType', name: '支付项类型' },
+    { key: 'isDeduct', name: '是否为扣款项' },
+    { key: 'isTotalTerms', name: '是否合计项' },
+    { key: 'payApplicableType', name: '适用类型' },
 ]
-const tableData = ref([
-    { key1: '1111' },
-])
+const tableData = ref([])
+//获取数据
+
+const getTableData = async () => {
+    tableLoading.value = true
+    const { error, code, data } = await payApi.getSyslist({
+       type:0,
+    })
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data)
+      
+    } else {
+        tableData.value = []
+  
+    }
+}
 
 //表格选择
+const selectList = ref([])
 const tableCheckChange = (checks) => {
-    console.log(checks)
+    selectList.value = checks
 }
-const modalSave = () => {
-    emit('finish')
+const saveLoading = ref(false)
+const modalSave = async () => {
+
+    saveLoading.value = true
+    const { error, code, msg } = await payApi.referenced({
+          projectId:projectId.value,
+          ids:arrToId(selectList.value),
+        })
+        //判断状态
+        saveLoading.value = false
+        if (!error && code === 200) {
+            window?.$message?.success(msg)
+         
+        }
+        emit('finish')
 }
 </script>

+ 179 - 39
src/views/project/debit/project/pay.vue

@@ -5,10 +5,16 @@
                 <template #header>
                     <el-button hc-btn type="primary" @click="systemPaymentClick">引用系统支付项</el-button>
                 </template>
-                <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" is-new :index-style="{ width: 60 }" is-current-row>
+                <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" is-new :index-style="{ width: 60 }" is-current-row @row-click="viewRowClick">
+                    <template #isDeduct="{ row }">
+                        <span>{{ row?.isDeduct === 1 ? '是' : '否' }}</span>
+                    </template>
+                    <template #isTotalTerms="{ row }">
+                        <span>{{ row?.isTotalTerms === 1 ? '是' : '否' }}</span>
+                    </template>
                     <template #action="{ row }">
                         <el-link type="success" @click="editRowClick(row)">修改</el-link>
-                        <el-link type="danger">删除</el-link>
+                        <el-link type="danger" @click="delRowClick(row)">删除</el-link>
                     </template>
                 </hc-table>
                 <template #action>
@@ -18,25 +24,28 @@
         </div>
         <div :id="`hc_info_card_${uuid}`" class="flex-1">
             <hc-new-card scrollbar>
-                <infoTable />
+                <infoTable :ids="rowViewId" />
                 <hc-title title="汇总项">
                     <template #extra>
-                        <el-link type="primary" @click="isCollectShow = true">添加汇总项</el-link>
+                        <el-link type="primary" @click="addColloect">添加汇总项</el-link>
                     </template>
                 </hc-title>
                 <hc-table :column="tableColumn1" :datas="tableData1" is-new :index-style="{ width: 60 }">
+                    <template #isDeduct="{ row }">
+                        <span>{{ row?.isDeduct === 1 ? '是' : '否' }}</span>
+                    </template>
                     <template #action="{ row }">
-                        <el-link type="danger">删除</el-link>
+                        <el-link type="danger" @click="delCollectRow(row)">删除</el-link>
                     </template>
                 </hc-table>
             </hc-new-card>
         </div>
 
         <!-- 引用系统支付项 -->
-        <systemPay v-model="systemPayShow" />
+        <systemPay v-model="systemPayShow" @finish="finishSystemPay" />
 
         <!-- 修改项目支付项 -->
-        <rowDataInfo v-model="isEditRowShow" />
+        <rowDataInfo v-model="isEditRowShow" :ids="rowDataId" @finish="finishEditRow" />
 
         <!-- 添加汇总项 -->
         <hc-new-dialog v-model="isCollectShow" is-table widths="1200px" title="添加汇总项" @save="collectModalSave">
@@ -66,7 +75,12 @@ import { getRandom } from 'js-fast-way'
 import infoTable from './components/pay/info-table.vue'
 import systemPay from './components/pay/system-pay.vue'
 import rowDataInfo from './components/pay/row-data.vue'
-
+import payApi from '~api/project/debit/project/pay.js'
+import { arrToId, getArrValue, getObjValue } from 'js-fast-way'
+import { useAppStore } from '~src/store'
+import { delMessageV2 } from '~com/message/index.js'
+const useAppState = useAppStore()
+const projectId = ref(useAppState.getProjectId)
 defineOptions({
     name: 'ProjectDebitProjectPay',
 })
@@ -76,6 +90,7 @@ const uuid = getRandom(4)
 //渲染完成
 onMounted(() => {
     setSplitRef()
+    getTableData()
 })
 
 //初始化设置拖动分割线
@@ -102,17 +117,36 @@ const pageChange = ({ current, size }) => {
 //表格数据
 const tableLoading = ref(false)
 const tableColumn = ref([
-    { key: 'key1', name: '支付项编号', width: 140 },
-    { key: 'key2', name: '支付项名称' },
-    { key: 'key3', name: '支付项类型', width: 160 },
-    { key: 'key4', name: '是否为扣款项', width: 100 },
-    { key: 'key5', name: '是否合计项', width: 100 },
-    { key: 'key5', name: '适用类型', width: 100 },
+    { key: 'payNumber', name: '支付项编号', width: 140 },
+    { key: 'payName', name: '支付项名称' },
+    { key: 'payType', name: '支付项类型', width: 160 },
+    { key: 'isDeduct', name: '是否为扣款项', width: 100 },
+    { key: 'isTotalTerms', name: '是否合计项', width: 100 },
+    { key: 'payApplicableType', name: '适用类型', width: 100 },
     { key: 'action', name: '操作', width: 100 },
 ])
-const tableData = ref([
-    { key1: '1111' },
-])
+const tableData = ref([])
+const getTableData = async () => {
+    tableLoading.value = true
+    const { error, code, data } = await payApi.getProListPage({
+       ...searchForm.value,
+       projectId:projectId.value,
+    })
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data['records'])
+        if (tableData.value.length > 0) {
+            getDetail(tableData.value[0].id)
+            rowViewId.value = tableData.value[0].id
+         
+        }
+       
+      
+    } else {
+        tableData.value = []
+  
+    }
+}
 
 //引用系统支付项
 const systemPayShow = ref(false)
@@ -120,45 +154,151 @@ const systemPaymentClick = () => {
     systemPayShow.value = true
 }
 
+const finishSystemPay = ()=>{
+    getTableData()
+    systemPayShow.value = false
+
+}
 //汇总项
 const tableColumn1 = ref([
-    { key: 'key1', name: '支付项编号' },
-    { key: 'key2', name: '支付项名称' },
-    { key: 'key3', name: '支付项类型' },
-    { key: 'key4', name: '合同计算公式' },
-    { key: 'key5', name: '变更计算公式' },
-    { key: 'key6', name: '本期计算公式' },
-    { key: 'key7', name: '是否为扣款项' },
+    { key: 'payNumber', name: '支付项编号' },
+    { key: 'payName', name: '支付项名称' },
+    { key: 'payType', name: '支付项类型' },
+    { key: 'contractFormulaIds', name: '合同计算公式' },
+    { key: 'updateFormulaIds', name: '变更计算公式' },
+    { key: 'currentFormulaIds', name: '本期计算公式' },
+    { key: 'isDeduct', name: '是否为扣款项' },
     { key: 'action', name: '操作', width: 50 },
 ])
-const tableData1 = ref([
-    { key1: '1111' },
-])
+const tableData1 = ref([])
 
 //修改
+const rowDataId = ref('')
+const rowViewId = ref('')
 const isEditRowShow = ref(false)
-const editRowClick = () => {
+const editRowClick = (row) => {
     isEditRowShow.value = true
+    rowDataId.value = row.id
+   
+}
+//获取节点详情
+const getDetail = async (id)=>{
+    const { error, code, data } = await payApi.getProDetail({
+       id,
+    })
+    if (!error && code === 200) {
+        tableData1.value = getObjValue(data)['summaryItemList']
+   
+    } else {
+        tableData1.value = []
+    }
+}
+const viewRowClick = ({ row })=>{
+    rowViewId.value = row.id
+    getDetail(row.id)
+}
+const finishEditRow = ()=>{
+    isEditRowShow.value = false
+    getTableData()
+}
+const delRowClick = async (row)=>{
+    delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                removeProPay(row.id)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
+            }
+    })
+}
+const removeProPay = async (id) => {
+    const { error, code } = await payApi.removeProList({
+        id: id, 
+    })
+    if (!error && code === 200) {
+        window?.$message?.success('删除成功')
+       getTableData()
+       rowViewId.value = ''
+    }
 }
-
 //添加汇总项
 const isCollectShow = ref(false)
-const collectModalSave = () => {
+const collectSaveLoading = ref(false)
+const collectModalSave = async () => {
+
+    collectSaveLoading.value = true
+    const { error, code, msg } = await payApi.addCollect({
+        bindIds	:selectTableCollectIds.value,
+        id:rowViewId.value,
+       
+        })
+        //判断状态
+        collectSaveLoading.value = false
+        if (!error && code === 200) {
+            window?.$message?.success(msg)
+            
+         
+        }
+        getDetail(rowViewId.value)
     isCollectShow.value = false
 }
-
+const addColloect = ()=>{
+    isCollectShow.value = true
+    getTableCollectData()
+}
+//删除汇总项
+const delCollectRow = (row)=>{
+    delMessageV2(async (action, instance, done) => {
+            if (action === 'confirm') {
+                instance.confirmButtonLoading = true
+                removeCollectPay(row.id)
+                instance.confirmButtonLoading = false
+                done()
+            } else {
+                done()
+            }
+    })
+}
+const removeCollectPay = async (id) => {
+    const { error, code } = await payApi.removeCollect({
+        id: rowViewId.value,
+        bindId:id,
+    })
+    if (!error && code === 200) {
+        window?.$message?.success('删除成功')
+        getDetail(rowViewId.value)
+    }
+}
 //添加汇总项
 const tableCollectColumn = ref([
-    { key: 'key1', name: '支付项编号' },
-    { key: 'key2', name: '支付项名称' },
-    { key: 'key3', name: '支付项类型' },
-    { key: 'key4', name: '是否为扣款项' },
-    { key: 'key5', name: '是否合计项' },
-    { key: 'key5', name: '支付项适用类型' },
+    { key: 'payNumber', name: '支付项编号' },
+    { key: 'payName', name: '支付项名称' },
+    { key: 'payType', name: '支付项类型' },
+    { key: 'isDeduct', name: '是否为扣款项' },
+    { key: 'isTotalTerms', name: '是否合计项' },
+    { key: 'payApplicableType', name: '支付项适用类型' },
 ])
 const tableCollectData = ref([])
 const tableCollectLoading = ref(false)
-const tableCollectCheckChange = () => {
-
+const getTableCollectData = async () => {
+    tableCollectLoading.value = true
+    const { error, code, data } = await payApi.getProPayList({
+       type:0,
+       projectId:projectId.value,
+    })
+    tableCollectLoading.value = false
+    if (!error && code === 200) {
+        tableCollectData.value = getArrValue(data)
+      
+    } else {
+        tableCollectData.value = []
+  
+    }
+}
+const selectTableCollectIds = ref('')
+const tableCollectCheckChange = (list) => {
+    selectTableCollectIds.value = arrToId(list)
 }
 </script>

+ 1 - 1
src/views/project/debit/project/unit.vue

@@ -83,7 +83,7 @@
 <script setup>
 import { nextTick, onMounted, ref } from 'vue'
 import { arrToId, getArrValue, getObjValue, getRandom } from 'js-fast-way'
-import unitApi from '~api/project/debit/unit.js'
+import unitApi from '~api/project/debit/project/unit.js'
 import { useAppStore } from '~src/store'
 import { getStoreValue, setStoreValue } from '~src/utils/storage'
 import { getDictionary } from '~api/other'