|
@@ -5,10 +5,16 @@
|
|
<template #header>
|
|
<template #header>
|
|
<el-button hc-btn type="primary" @click="systemPaymentClick">引用系统支付项</el-button>
|
|
<el-button hc-btn type="primary" @click="systemPaymentClick">引用系统支付项</el-button>
|
|
</template>
|
|
</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 }">
|
|
<template #action="{ row }">
|
|
<el-link type="success" @click="editRowClick(row)">修改</el-link>
|
|
<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>
|
|
</template>
|
|
</hc-table>
|
|
</hc-table>
|
|
<template #action>
|
|
<template #action>
|
|
@@ -18,25 +24,28 @@
|
|
</div>
|
|
</div>
|
|
<div :id="`hc_info_card_${uuid}`" class="flex-1">
|
|
<div :id="`hc_info_card_${uuid}`" class="flex-1">
|
|
<hc-new-card scrollbar>
|
|
<hc-new-card scrollbar>
|
|
- <infoTable />
|
|
|
|
|
|
+ <infoTable :ids="rowViewId" />
|
|
<hc-title title="汇总项">
|
|
<hc-title title="汇总项">
|
|
<template #extra>
|
|
<template #extra>
|
|
- <el-link type="primary" @click="isCollectShow = true">添加汇总项</el-link>
|
|
|
|
|
|
+ <el-link type="primary" @click="addColloect">添加汇总项</el-link>
|
|
</template>
|
|
</template>
|
|
</hc-title>
|
|
</hc-title>
|
|
<hc-table :column="tableColumn1" :datas="tableData1" is-new :index-style="{ width: 60 }">
|
|
<hc-table :column="tableColumn1" :datas="tableData1" is-new :index-style="{ width: 60 }">
|
|
|
|
+ <template #isDeduct="{ row }">
|
|
|
|
+ <span>{{ row?.isDeduct === 1 ? '是' : '否' }}</span>
|
|
|
|
+ </template>
|
|
<template #action="{ row }">
|
|
<template #action="{ row }">
|
|
- <el-link type="danger">删除</el-link>
|
|
|
|
|
|
+ <el-link type="danger" @click="delCollectRow(row)">删除</el-link>
|
|
</template>
|
|
</template>
|
|
</hc-table>
|
|
</hc-table>
|
|
</hc-new-card>
|
|
</hc-new-card>
|
|
</div>
|
|
</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">
|
|
<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 infoTable from './components/pay/info-table.vue'
|
|
import systemPay from './components/pay/system-pay.vue'
|
|
import systemPay from './components/pay/system-pay.vue'
|
|
import rowDataInfo from './components/pay/row-data.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({
|
|
defineOptions({
|
|
name: 'ProjectDebitProjectPay',
|
|
name: 'ProjectDebitProjectPay',
|
|
})
|
|
})
|
|
@@ -76,6 +90,7 @@ const uuid = getRandom(4)
|
|
//渲染完成
|
|
//渲染完成
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
setSplitRef()
|
|
setSplitRef()
|
|
|
|
+ getTableData()
|
|
})
|
|
})
|
|
|
|
|
|
//初始化设置拖动分割线
|
|
//初始化设置拖动分割线
|
|
@@ -102,17 +117,36 @@ const pageChange = ({ current, size }) => {
|
|
//表格数据
|
|
//表格数据
|
|
const tableLoading = ref(false)
|
|
const tableLoading = ref(false)
|
|
const tableColumn = ref([
|
|
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 },
|
|
{ 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)
|
|
const systemPayShow = ref(false)
|
|
@@ -120,45 +154,151 @@ const systemPaymentClick = () => {
|
|
systemPayShow.value = true
|
|
systemPayShow.value = true
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const finishSystemPay = ()=>{
|
|
|
|
+ getTableData()
|
|
|
|
+ systemPayShow.value = false
|
|
|
|
+
|
|
|
|
+}
|
|
//汇总项
|
|
//汇总项
|
|
const tableColumn1 = ref([
|
|
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 },
|
|
{ key: 'action', name: '操作', width: 50 },
|
|
])
|
|
])
|
|
-const tableData1 = ref([
|
|
|
|
- { key1: '1111' },
|
|
|
|
-])
|
|
|
|
|
|
+const tableData1 = ref([])
|
|
|
|
|
|
//修改
|
|
//修改
|
|
|
|
+const rowDataId = ref('')
|
|
|
|
+const rowViewId = ref('')
|
|
const isEditRowShow = ref(false)
|
|
const isEditRowShow = ref(false)
|
|
-const editRowClick = () => {
|
|
|
|
|
|
+const editRowClick = (row) => {
|
|
isEditRowShow.value = true
|
|
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 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
|
|
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([
|
|
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 tableCollectData = ref([])
|
|
const tableCollectLoading = ref(false)
|
|
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>
|
|
</script>
|