Browse Source

项目中期支付项入参

liuyc 1 year ago
parent
commit
4911322718
1 changed files with 100 additions and 97 deletions
  1. 100 97
      src/views/project/debit/project/pay.vue

+ 100 - 97
src/views/project/debit/project/pay.vue

@@ -5,7 +5,8 @@
                 <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 @row-click="viewRowClick">
+                <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>
@@ -18,13 +19,13 @@
                     </template>
                 </hc-table>
                 <template #action>
-                    <hc-pages :pages="searchForm" @change="pageChange" />
+                    <hc-pages :pages="searchForm" @change="pageChange"/>
                 </template>
             </hc-new-card>
         </div>
         <div :id="`hc_info_card_${uuid}`" class="flex-1">
             <hc-new-card scrollbar>
-                <infoTable :ids="rowViewId" />
+                <infoTable :ids="rowViewId"/>
                 <hc-title title="汇总项">
                     <template #extra>
                         <el-link type="primary" @click="addColloect">添加汇总项</el-link>
@@ -42,10 +43,10 @@
         </div>
 
         <!-- 引用系统支付项 -->
-        <systemPay v-model="systemPayShow" @finish="finishSystemPay" />
+        <systemPay v-model="systemPayShow" @finish="finishSystemPay"/>
 
         <!-- 修改项目支付项 -->
-        <rowDataInfo v-model="isEditRowShow" :ids="rowDataId" @finish="finishEditRow" />
+        <rowDataInfo v-model="isEditRowShow" :ids="rowDataId" @finish="finishEditRow"/>
 
         <!-- 添加汇总项 -->
         <hc-new-dialog v-model="isCollectShow" is-table widths="1200px" title="添加汇总项" @save="collectModalSave">
@@ -77,16 +78,17 @@
 </template>
 
 <script setup>
-import { nextTick, onMounted, ref } from 'vue'
-import { getRandom } from 'js-fast-way'
+import {nextTick, onMounted, ref} from 'vue'
+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'
-import { getDictionary } from '~api/other'
+import {arrToId, getArrValue, getObjValue} from 'js-fast-way'
+import {useAppStore} from '~src/store'
+import {delMessageV2} from '~com/message/index.js'
+import {getDictionary} from '~api/other'
+
 const useAppState = useAppStore()
 const projectId = ref(useAppState.getProjectId)
 defineOptions({
@@ -118,11 +120,11 @@ const setSplitRef = () => {
 //获支付项类型
 const payOptions = ref([])
 const gePayType = async () => {
-    const { data } = await getDictionary({
+    const {data} = await getDictionary({
         code: 'meter_pay_type',
     })
     payOptions.value = getArrValue(data)
-    payOptions.value.forEach((ele)=>{
+    payOptions.value.forEach((ele) => {
         ele.dictKey = Number(ele.dictKey)
     })
 }
@@ -130,19 +132,19 @@ const gePayType = async () => {
 //获支付项适用类型
 const payAppOptions = ref([])
 const gePayAppType = async () => {
-    const { data } = await getDictionary({
+    const {data} = await getDictionary({
         code: 'meter_pay_applicable_type',
     })
     payAppOptions.value = getArrValue(data)
-    payAppOptions.value.forEach((ele)=>{
+    payAppOptions.value.forEach((ele) => {
         ele.dictKey = Number(ele.dictKey)
     })
 }
 //搜索表单
-const searchForm = ref({ current: 1, size: 10, total: 0 })
+const searchForm = ref({current: 1, size: 10, total: 0})
 
 //分页
-const pageChange = ({ current, size }) => {
+const pageChange = ({current, size}) => {
     searchForm.value.current = current
     searchForm.value.size = size
     getTableData()
@@ -151,20 +153,20 @@ const pageChange = ({ current, size }) => {
 //表格数据
 const tableLoading = ref(false)
 const tableColumn = ref([
-    { key: 'payNumber', name: '支付项编号', width: 140 },
-    { key: 'payName', name: '支付项名称' },
-    { key: 'payTypeName', name: '支付项类型', width: 160 },
-    { key: 'isDeduct', name: '是否为扣款项', width: 100 },
-    { key: 'isTotalTerms', name: '是否合计项', width: 100 },
-    { key: 'payApplicableTypeName', name: '适用类型', width: 100 },
-    { key: 'action', name: '操作', width: 100 },
+    {key: 'payNumber', name: '支付项编号', width: 140},
+    {key: 'payName', name: '支付项名称'},
+    {key: 'payTypeName', name: '支付项类型', width: 160},
+    {key: 'isDeduct', name: '是否为扣款项', width: 100},
+    {key: 'isTotalTerms', name: '是否合计项', width: 100},
+    {key: 'payApplicableTypeName', name: '适用类型', width: 100},
+    {key: 'action', name: '操作', width: 100},
 ])
 const tableData = ref([])
 const getTableData = async () => {
     tableLoading.value = true
-    const { error, code, data } = await payApi.getProListPage({
-       ...searchForm.value,
-       projectId:projectId.value,
+    const {error, code, data} = await payApi.getProListPage({
+        ...searchForm.value,
+        projectId: projectId.value,
     })
     tableLoading.value = false
     if (!error && code === 200) {
@@ -173,14 +175,14 @@ const getTableData = async () => {
         if (tableData.value.length > 0) {
             getDetail(tableData.value[0].id)
             rowViewId.value = tableData.value[0].id
-         
+
         }
-       
-      
+
+
     } else {
         tableData.value = []
         searchForm.value.total = 0
-  
+
     }
 }
 
@@ -190,21 +192,21 @@ const systemPaymentClick = () => {
     systemPayShow.value = true
 }
 
-const finishSystemPay = ()=>{
+const finishSystemPay = () => {
     getTableData()
     systemPayShow.value = false
 
 }
 //汇总项
 const tableColumn1 = ref([
-    { key: 'payNumber', name: '支付项编号' },
-    { key: 'payName', name: '支付项名称' },
-    { key: 'payTypeName', name: '支付项类型' },
-    { key: 'contractFormulaIds', name: '合同计算公式' },
-    { key: 'updateFormulaIds', name: '变更计算公式' },
-    { key: 'currentFormulaIds', name: '本期计算公式' },
-    { key: 'isDeduct', name: '是否为扣款项' },
-    { key: 'action', name: '操作', width: 50 },
+    {key: 'payNumber', name: '支付项编号'},
+    {key: 'payName', name: '支付项名称'},
+    {key: 'payTypeName', name: '支付项类型'},
+    {key: 'contractFormulaIds', name: '合同计算公式'},
+    {key: 'updateFormulaIds', name: '变更计算公式'},
+    {key: 'currentFormulaIds', name: '本期计算公式'},
+    {key: 'isDeduct', name: '是否为扣款项'},
+    {key: 'action', name: '操作', width: 50},
 ])
 const tableData1 = ref([])
 
@@ -215,48 +217,48 @@ const isEditRowShow = ref(false)
 const editRowClick = (row) => {
     isEditRowShow.value = true
     rowDataId.value = row.id
-   
+
 }
 //获取节点详情
-const getDetail = async (id)=>{
-    const { error, code, data } = await payApi.getProDetail({
-       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 })=>{
+const viewRowClick = ({row}) => {
     rowViewId.value = row.id
     getDetail(row.id)
 }
-const finishEditRow = ()=>{
+const finishEditRow = () => {
     isEditRowShow.value = false
     getTableData()
 }
-const delRowClick = async (row)=>{
+const delRowClick = async (row) => {
     delMessageV2(async (action, instance, done) => {
-            if (action === 'confirm') {
-                instance.confirmButtonLoading = true
-                removeProPay(row.id)
-                instance.confirmButtonLoading = false
-                done()
-            } else {
-                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, 
+    const {error, code} = await payApi.removeProList({
+        id: id,
     })
     if (!error && code === 200) {
         window?.$message?.success('删除成功')
-       getTableData()
-       rowViewId.value = ''
+        getTableData()
+        rowViewId.value = ''
     }
 }
 //添加汇总项
@@ -265,43 +267,43 @@ 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)
+    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 = ()=>{
+const addColloect = () => {
     isCollectShow.value = true
     getTableCollectData()
     selectArr.value = []
 }
 //删除汇总项
-const delCollectRow = (row)=>{
+const delCollectRow = (row) => {
     delMessageV2(async (action, instance, done) => {
-            if (action === 'confirm') {
-                instance.confirmButtonLoading = true
-                removeCollectPay(row.id)
-                instance.confirmButtonLoading = false
-                done()
-            } else {
-                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({
+    const {error, code} = await payApi.removeCollect({
         id: rowViewId.value,
-        bindId:id,
+        bindId: id,
     })
     if (!error && code === 200) {
         window?.$message?.success('删除成功')
@@ -310,29 +312,30 @@ const removeCollectPay = async (id) => {
 }
 //添加汇总项
 const tableCollectColumn = ref([
-    { key: 'payNumber', name: '支付项编号' },
-    { key: 'payName', name: '支付项名称' },
-    { key: 'payTypeName', name: '支付项类型' },
-    { key: 'isDeduct', name: '是否为扣款项' },
-    { key: 'isTotalTerms', name: '是否合计项' },
-    { key: 'payApplicableTypeName', name: '支付项适用类型' },
+    {key: 'payNumber', name: '支付项编号'},
+    {key: 'payName', name: '支付项名称'},
+    {key: 'payTypeName', name: '支付项类型'},
+    {key: 'isDeduct', name: '是否为扣款项'},
+    {key: 'isTotalTerms', name: '是否合计项'},
+    {key: 'payApplicableTypeName', name: '支付项适用类型'},
 ])
 const tableCollectData = ref([])
 const tableCollectLoading = ref(false)
 const getTableCollectData = async () => {
     tableCollectLoading.value = true
-    const { error, code, data } = await payApi.getProListPage({
-       type:1,
-       projectId:projectId.value,
-       current: 1, size: 10000,
+    const {error, code, data} = await payApi.getProListPage({
+        type: 1,
+        recordId: rowViewId.value,
+        projectId: projectId.value,
+        current: 1, size: 10000,
     })
     tableCollectLoading.value = false
     if (!error && code === 200) {
         tableCollectData.value = getArrValue(data['records'])
-      
+
     } else {
         tableCollectData.value = []
-  
+
     }
 }
 const selectTableCollectIds = ref('')