Selaa lähdekoodia

支付项入参

liuyc 1 vuosi sitten
vanhempi
commit
0e60cd5c7e

+ 28 - 27
src/views/project/debit/contract/components/pay/system-pay.vue

@@ -16,11 +16,12 @@
 </template>
 
 <script setup>
-import { ref, watch } from 'vue'
+import {ref, watch} from 'vue'
 import payApiPr from '~api/project/debit/project/pay.js'
 import payApiCo from '~api/project/debit/contract/pay.js'
-import { arrToId, getArrValue } from 'js-fast-way'
-import { useAppStore } from '~src/store'
+import {arrToId, getArrValue} from 'js-fast-way'
+import {useAppStore} from '~src/store'
+
 const props = defineProps({
     ids: {
         type: [String, Number],
@@ -43,7 +44,7 @@ watch(() => [
     props.ids,
 ], ([ids]) => {
     console.log('ids', ids)
-}, { immediate: true })
+}, {immediate: true})
 
 //监听
 watch(isShow, (val) => {
@@ -55,29 +56,29 @@ watch(isShow, (val) => {
 //表格数据
 const tableLoading = ref(false)
 const tableColumn = [
-    { key: 'payNumber', name: '支付项编号' },
-    { key: 'payName', name: '支付项名称' },
-    { key: 'payType', name: '支付项类型' },
-    { key: 'isDeduct', name: '是否为扣款项' },
-    { key: 'isTotalTerms', name: '是否合计项' },
-    { key: 'payApplicableType', name: '适用类型' },
+    {key: 'payNumber', name: '支付项编号'},
+    {key: 'payName', name: '支付项名称'},
+    {key: 'payType', name: '支付项类型'},
+    {key: 'isDeduct', name: '是否为扣款项'},
+    {key: 'isTotalTerms', name: '是否合计项'},
+    {key: 'payApplicableType', name: '适用类型'},
 ]
 const tableData = ref([])
 //获取数据
 
 const getTableData = async () => {
     tableLoading.value = true
-    const { error, code, data } = await payApiPr.getProPayList({
-       type:0,
-       projectId:projectId.value,
+    const {error, code, data} = await payApiPr.getProPayList({
+        contractId: contractId.value,
+        projectId: projectId.value,
     })
     tableLoading.value = false
     if (!error && code === 200) {
         tableData.value = getArrValue(data)
-      
+
     } else {
         tableData.value = []
-  
+
     }
 }
 
@@ -90,17 +91,17 @@ const saveLoading = ref(false)
 const modalSave = async () => {
 
     saveLoading.value = true
-    const { error, code, msg } = await payApiCo.referenced({
-          projectId:projectId.value,
-          ids:arrToId(selectList.value),
-          contractId:contractId.value,
-        })
-        //判断状态
-        saveLoading.value = false
-        if (!error && code === 200) {
-            window?.$message?.success(msg)
-         
-        }
-        emit('finish')
+    const {error, code, msg} = await payApiCo.referenced({
+        projectId: projectId.value,
+        ids: arrToId(selectList.value),
+        contractId: contractId.value,
+    })
+    //判断状态
+    saveLoading.value = false
+    if (!error && code === 200) {
+        window?.$message?.success(msg)
+
+    }
+    emit('finish')
 }
 </script>

+ 95 - 92
src/views/project/debit/contract/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,15 +78,16 @@
 </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/contract/pay.js'
-import { arrToId, getArrValue, getObjValue } from 'js-fast-way'
-import { useAppStore } from '~src/store'
-import { delMessageV2 } from '~com/message/index.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)
 const contractId = ref(useAppState.getContractId)
@@ -114,10 +116,10 @@ const setSplitRef = () => {
 }
 
 //搜索表单
-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()
@@ -126,20 +128,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,
-       contractId:contractId.value,
+    const {error, code, data} = await payApi.getProListPage({
+        ...searchForm.value,
+        contractId: contractId.value,
     })
     tableLoading.value = false
     if (!error && code === 200) {
@@ -148,14 +150,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
-  
+
     }
 }
 
@@ -165,21 +167,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([])
 
@@ -190,48 +192,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 = ''
     }
 }
 //添加汇总项
@@ -240,43 +242,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('删除成功')
@@ -285,29 +287,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',
-       contractId:contractId.value,
-       current: 1, size: 100000,
+    const {error, code, data} = await payApi.getProListPage({
+        type: '1',
+        contractId: contractId.value,
+        recordId: rowViewId.value,
+        current: 1, size: 100000,
     })
     tableCollectLoading.value = false
     if (!error && code === 200) {
         tableCollectData.value = getArrValue(data['records'])
-      
+
     } else {
         tableCollectData.value = []
-  
+
     }
 }
 const selectTableCollectIds = ref('')