|
@@ -1,30 +1,31 @@
|
|
|
<script setup lang="ts">
|
|
|
import { ref, computed } from "vue";
|
|
|
-import contentConfig from "./config/content.config";
|
|
|
-import searchConfig from "./config/search.config";
|
|
|
-import CapitalModal from "./components/capital-modal.vue";
|
|
|
import { usePageSearch, type PageHooks, type PageEvents } from "/@/hooks/page";
|
|
|
+import { httpWithdraw, httpBatchStatus } from "/@/api/InvoiceSales/capitalClaim";
|
|
|
+import ExcelCapitalUpload from "./components/execl-capital-files-upload/index.vue";
|
|
|
+import { template, capitalTemplate } from "./config/xls-template";
|
|
|
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
|
|
|
import { usePermission } from "/@/hooks/core/usePermission";
|
|
|
-import { httpWithdraw, httpBatchStatus } from "/@/api/InvoiceSales/capitalClaim";
|
|
|
-import { useAsync } from "/@/hooks/core/useAsync";
|
|
|
-import { useRouter } from "vue-router";
|
|
|
-import { useTask } from "/@/hooks/core"
|
|
|
-import { ElMessage } from "element-plus"
|
|
|
import { useCompany } from "/@/hooks/core/useCompany";
|
|
|
+import CapitalModal from "./components/capital-modal.vue";
|
|
|
+import contentConfig from "./config/content.config";
|
|
|
import { httpRequsetExport } from "/@/utils/export";
|
|
|
import { useUserInfo } from "/@/hooks/core/useUser";
|
|
|
-import { template, capitalTemplate } from "./config/xls-template";
|
|
|
-import ExeclCapitalUpload from "./components/execl-capital-files-upload/index.vue";
|
|
|
+import searchConfig from "./config/search.config";
|
|
|
+import { useAsync } from "/@/hooks/core/useAsync";
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
import { utils, writeFile } from "xlsx";
|
|
|
+import { useTask } from "/@/hooks/core";
|
|
|
+import { useRouter } from "vue-router";
|
|
|
+
|
|
|
|
|
|
import { cloneDeep } from "lodash-unified";
|
|
|
|
|
|
const PageName = "capitalPool";
|
|
|
|
|
|
const selected = ref([])
|
|
|
-const formRef = ref<any>(null)
|
|
|
const visible = ref(false)
|
|
|
+const formRef = ref<any>(null)
|
|
|
|
|
|
const loading = ref(false);
|
|
|
const { currentCompany } = useCompany();
|
|
@@ -32,8 +33,6 @@ const formData = ref({ status: '', remark: '' })
|
|
|
|
|
|
const contenConfigtRef = ref(contentConfig)
|
|
|
|
|
|
-console.log(contenConfigtRef.value)
|
|
|
-
|
|
|
const rules = computed(() => ({
|
|
|
status: [{ required: true, message: "请选择审核状态", trigger: 'change' }],
|
|
|
remark: [{ required: formData.value.status == '3', message: "请选择审核状态", trigger: 'change' }],
|
|
@@ -72,9 +71,10 @@ const events: PageEvents = {
|
|
|
const { pcData = {} } = data
|
|
|
const { pcCode } = parameter
|
|
|
const { balancePrce, totalPrice, tradPrice, usedPrice } = pcData
|
|
|
+ const total = Number(balancePrce) + Number(tradPrice) + Number(usedPrice)
|
|
|
|
|
|
- if(totalPrice != 0){
|
|
|
- contenConfigtRef.value.title = `批次号总金额:${totalPrice},订单已认领总金额: ${usedPrice},订单认领中总金额: ${tradPrice}, 订单未认领总金额: ${totalPrice}`
|
|
|
+ if(total != 0){
|
|
|
+ contenConfigtRef.value.title = `批次号总金额:${total},订单已认领总金额: ${usedPrice},订单认领中总金额: ${tradPrice}, 订单未认领总金额: ${balancePrce}`
|
|
|
} else {
|
|
|
contenConfigtRef.value.title = ''
|
|
|
}
|
|
@@ -122,9 +122,7 @@ async function onDownloadOpenInv() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
const { start, end, ...rest } = params
|
|
|
-
|
|
|
const parameter = {
|
|
|
create_start: start,
|
|
|
create_end: end,
|
|
@@ -144,8 +142,8 @@ async function onDownloadOpenInv() {
|
|
|
await httpRequsetExport({
|
|
|
url: "ope",
|
|
|
name: "资金认领数据表",
|
|
|
- onStart: () => (loading.value = true),
|
|
|
onSuccess: () => (loading.value = false),
|
|
|
+ onStart: () => (loading.value = true),
|
|
|
onFail: () => (loading.value = false),
|
|
|
params: { ...parameter, company: currentCompany.value.companyNo }
|
|
|
});
|
|
@@ -156,9 +154,9 @@ async function handleBatchSubmit(){
|
|
|
try{
|
|
|
await formRef.value?.validate()
|
|
|
batchTask.run(httpBatchStatus({
|
|
|
- idArr: selected.value.map(({id}) => id),
|
|
|
- status: formData.value.status,
|
|
|
- remark: formData.value.remark
|
|
|
+ idArr: selected.value.map(({ id }) => id),
|
|
|
+ status: formData.value.status,
|
|
|
+ remark: formData.value.remark
|
|
|
}))
|
|
|
}catch(err){
|
|
|
console.log(err)
|
|
@@ -173,11 +171,11 @@ function handleImportData(){
|
|
|
<template>
|
|
|
<div>
|
|
|
<PageAuth :pageName="PageName" class="capital-claim">
|
|
|
- <PageContainer
|
|
|
+ <PageContainer
|
|
|
:hooks="hooks"
|
|
|
- :events="events"
|
|
|
- :content-config="contenConfigtRef"
|
|
|
+ :events="events"
|
|
|
:search-config="searchConfig"
|
|
|
+ :content-config="contenConfigtRef"
|
|
|
:get-content-ref="ref => pageContentRef = ref"
|
|
|
@content-select-change="values => selected = values"
|
|
|
>
|
|
@@ -197,7 +195,8 @@ function handleImportData(){
|
|
|
placement="top"
|
|
|
title="是否确认撤销资金认领?"
|
|
|
@confirm="() => handleWithDraw({ logNo: row.logNo })"
|
|
|
- >
|
|
|
+ v-if="hasPermissionWithCode('009') && String(row.status) === '1'"
|
|
|
+ >
|
|
|
<template #reference>
|
|
|
<el-button :icon="useRenderIcon('refresh-right')" type="primary" link />
|
|
|
</template>
|
|
@@ -229,10 +228,10 @@ function handleImportData(){
|
|
|
</el-button>
|
|
|
</el-button-group>
|
|
|
</template>
|
|
|
- </PageContainer>
|
|
|
- <CapitalModal ref="capitalModalRef" />
|
|
|
+ </PageContainer>
|
|
|
+ <CapitalModal ref="capitalModalRef" />
|
|
|
|
|
|
- <ElDialog v-model="visible" title="批量审批" center @close="formData = { status: '', remark: '' }">
|
|
|
+ <ElDialog v-model="visible" title="批量审批" center @close="formData = { status: '', remark: '' }">
|
|
|
<ElForm :model="formData" :rules="rules" ref="formRef" v-loading="batchTask.loading">
|
|
|
<ElFormItem prop="status" label="审核状态">
|
|
|
<ElSelect placeholder="审核状态" v-model="formData.status" style="width: 100%">
|
|
@@ -257,9 +256,9 @@ function handleImportData(){
|
|
|
</div>
|
|
|
</ElFormItem>
|
|
|
</ElForm>
|
|
|
- </ElDialog>
|
|
|
- </PageAuth>
|
|
|
+ </ElDialog>
|
|
|
+ </PageAuth>
|
|
|
|
|
|
- <ExeclCapitalUpload ref="execlCapitalUploadRef" @onSuccess="pageContentRef.onSearch()" />
|
|
|
+ <ExeclCapitalUpload ref="execlCapitalUploadRef" @onSuccess="pageContentRef.onSearch()" />
|
|
|
</div>
|
|
|
</template>
|