2024-05-15 09:58:02 +08:00

144 lines
7.2 KiB
Vue

<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="合同名称" prop="contract_name">
<el-input class="w-[280px]" v-model="queryParams.contract_name" clearable placeholder="请输入合同名称" />
</el-form-item>
<el-form-item label="合同编号" prop="contract_num">
<el-input class="w-[280px]" v-model="queryParams.contract_num" clearable placeholder="请输入合同编号" />
</el-form-item>
<el-form-item label="甲方单位" prop="part_b">
<el-input class="w-[280px]" v-model="queryParams.part_b" clearable placeholder="请输入甲方单位" />
</el-form-item>
<el-form-item label="合同类型" prop="contract_type">
<el-input class="w-[280px]" v-model="queryParams.contract_type" clearable placeholder="请输入合同类型" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table border :data="pager.lists">
<el-table-column label="合同名称" prop="contract_name" :render-header="pager.calcWidth" />
<el-table-column :render-header="pager.calcWidth" label="合同编号" prop="contract_code" />
<el-table-column :render-header="pager.calcWidth" label="合同类型" prop="contract_type_text"
show-overflow-tooltip />
<el-table-column label="业务性质" :render-header="pager.calcWidth" prop="business_nature_text"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="签约单位" prop="part_a_name"
show-overflow-tooltip />
<el-table-column label="签订部门" :render-header="pager.calcWidth" prop="signed_dept_name"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="合同签订金额" prop="signed_amount"
show-overflow-tooltip />
<!-- <el-table-column :render-header="pager.calcWidth" label="开票日期" prop="" show-overflow-tooltip /> -->
<el-table-column :render-header="pager.calcWidth" label="已开票金额" prop="total_invoice_amount"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="未开票金额" prop="not_total_invoice_amount"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="开票已回款金额" prop="invoice_has_refund_amount"
show-overflow-tooltip />
<el-table-column label="开票未回款金额" prop="invoice_not_refund_amount" show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="合同未回款金额" prop="" show-overflow-tooltip>
<template #default="{ row }">
{{ (+row.signed_amount) - (+row.total_refund_amount) }}
</template>
</el-table-column>
<el-table-column :render-header="pager.calcWidth" label="回款日期" prop="refund_date"
show-overflow-tooltip />
<!-- <el-table-column label="备注" prop="reamrk" show-overflow-tooltip /> -->
<!-- <el-table-column :render-header="pager.calcWidth" label="已到账金额" prop="total_refund_amount"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="已结算金额" prop="total_settlement_amount"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="未到账金额" prop="not_total_refund_amount"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="回款未开票金额" prop="refund_not_invoice_amount"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="合同结算日期" prop="settlement_date"
show-overflow-tooltip /> -->
<el-table-column label="操作" width="150" fixed="right">
<template #default="{ row }">
<el-button v-perms="['contract.contract_negotiation/delete']" type="primary" link
@click="handleDetail(row.id)">
详情
</el-button>
<el-button v-perms="['contract.contract_negotiation/detail']" link
@click="handleDown(row.id)">
下载
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<detailPage v-if="showDetail" ref="detailRef" @close="showDetail = false" :detailConfig="detailConfig" />
<!-- <edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" /> -->
</div>
</template>
<script lang="ts" setup name="financialRefundLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiContractLedgerLists, apiMarketingContract, apiMarketingContractdownload } from '@/api/contract_ledger'
import feedback from '@/utils/feedback'
import detailConfig from './detail'
// import EditPopup from './edit.vue'
const detailRef = shallowRef<InstanceType<typeof EditPopup>>()
// // 是否显示编辑框
const showDetail = ref(false)
// 查询条件
const queryParams = reactive({
contract_name: "",
part_b: '',
contract_type: '',
})
// 选中数据
const selectData = ref<any[]>([])
// 获取字典数据
const { dictData } = useDictData('cost_consultation_business_nature,cost_contract_type')
// 分页相关
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiContractLedgerLists,
params: queryParams
})
// 详情
const handleDetail = async (id: any) => {
let res = await apiMarketingContract({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
// 下载
const handleDown = async (id: number | any[]) => {
let res = await apiMarketingContractdownload({ id })
const a = document.createElement('a')
a.href = res.url
a.click()
}
getLists()
</script>