|
@@ -4,7 +4,13 @@ import { FormConfigType } from '@/components/AForm/type'
|
|
|
import { ToolbarConfigType } from '@/components/AToolbar/type'
|
|
|
import { ColumnConfigType } from '@/components/ATable/type'
|
|
|
import { StrAnyObj, StrAnyObjArr } from '@/typings'
|
|
|
-import { addApi, editApi, getDetailApi, getRemitPageApi } from '@/api/business/payment/requests'
|
|
|
+import {
|
|
|
+ addApi,
|
|
|
+ editApi,
|
|
|
+ getDetailApi,
|
|
|
+ getRemitPageApi,
|
|
|
+ remitApi
|
|
|
+} from '@/api/business/payment/requests'
|
|
|
import { getPageApi as getCorporationPageApi } from '@/api/business/corporation/corporation'
|
|
|
import DeptTreeSelect from '@/views/components/DeptTreeSelect/index.vue'
|
|
|
import { getPageApi as getCapitalAccountPageApi } from '@/api/business/capital/account'
|
|
@@ -18,7 +24,8 @@ const pageTotal = ref<number>(0)
|
|
|
|
|
|
const queryData = ref<StrAnyObj>({ pageNum: 1, pageSize: 10 })
|
|
|
const tableData = ref<StrAnyObjArr>([])
|
|
|
-const formData = ref<StrAnyObj>({ paymentRequestsDetailList: [{}] })
|
|
|
+const detailData = ref<StrAnyObj>({ paymentRequestsDetailList: [{}] })
|
|
|
+const formData = ref<StrAnyObj>({})
|
|
|
|
|
|
const dialogTitle = ref<string>('')
|
|
|
const dialogVisible = ref<boolean>(false)
|
|
@@ -154,13 +161,29 @@ const columnConfig: ColumnConfigType[] = [
|
|
|
width: 250,
|
|
|
handleConfig: [
|
|
|
{
|
|
|
+ text: '打款',
|
|
|
+ if: (row) => row.paymentStatus != 2,
|
|
|
+ click(row) {
|
|
|
+ dialogVisible.value = true
|
|
|
+ dialogTitle.value = '打款'
|
|
|
+ disabled.value = false
|
|
|
+ getDetailApi({ id: row.id }).then((resp: StrAnyObj) => {
|
|
|
+ detailData.value = resp
|
|
|
+ formData.value.capitalAccountId = resp.capitalAccountId
|
|
|
+ formData.value.amount = resp.totalAmount - resp.remitAmount
|
|
|
+ formData.value.remark = resp.useRemark
|
|
|
+ formData.value.paymentRequestsId = resp.id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
common: 'detail',
|
|
|
click(row) {
|
|
|
dialogVisible.value = true
|
|
|
dialogTitle.value = '详情'
|
|
|
disabled.value = true
|
|
|
getDetailApi({ id: row.id }).then((resp: StrAnyObj) => {
|
|
|
- formData.value = resp
|
|
|
+ detailData.value = resp
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -168,19 +191,18 @@ const columnConfig: ColumnConfigType[] = [
|
|
|
}
|
|
|
]
|
|
|
|
|
|
-const formConfig: FormConfigType[] = [
|
|
|
+const detailConfig: FormConfigType[] = [
|
|
|
{
|
|
|
- type: 'select',
|
|
|
- prop: 'type',
|
|
|
- label: '请款类型',
|
|
|
- dict: 'payment_requests_type',
|
|
|
+ type: 'input',
|
|
|
+ prop: 'totalAmount',
|
|
|
+ label: '请款金额',
|
|
|
placeholder: '',
|
|
|
disabled: true
|
|
|
},
|
|
|
{
|
|
|
type: 'input',
|
|
|
- prop: 'totalAmount',
|
|
|
- label: '请款金额',
|
|
|
+ prop: 'remitAmount',
|
|
|
+ label: '已打款金额',
|
|
|
placeholder: '',
|
|
|
disabled: true
|
|
|
},
|
|
@@ -242,6 +264,58 @@ const formConfig: FormConfigType[] = [
|
|
|
span: 24,
|
|
|
placeholder: '',
|
|
|
disabled: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'upload',
|
|
|
+ prop: 'atts',
|
|
|
+ label: '附件',
|
|
|
+ span: 24
|
|
|
+ }
|
|
|
+]
|
|
|
+
|
|
|
+const formConfig: FormConfigType[] = [
|
|
|
+ {
|
|
|
+ type: 'select',
|
|
|
+ prop: 'capitalAccountId',
|
|
|
+ label: '付款账户',
|
|
|
+ keyName: 'id',
|
|
|
+ labelName: 'accountAlias',
|
|
|
+ async option() {
|
|
|
+ const data = await getCapitalAccountPageApi({ searchAll: true })
|
|
|
+ return data.records
|
|
|
+ },
|
|
|
+ rule: [{ required: true, message: '付款账户不能为空', trigger: 'blur' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'inputNumber',
|
|
|
+ prop: 'amount',
|
|
|
+ label: '打款金额',
|
|
|
+ min: 0.01,
|
|
|
+ precision: 2,
|
|
|
+ rule: [{ required: true, message: '打款金额不能为空', trigger: 'blur' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'datePicker',
|
|
|
+ prop: 'remitTime',
|
|
|
+ label: '打款时间',
|
|
|
+ datePickerType: 'datetime',
|
|
|
+ format: 'YYYY-MM-DD 00:00:00',
|
|
|
+ valueFormat: 'YYYY-MM-DD 00:00:00',
|
|
|
+ rule: [{ required: true, message: '打款时间不能为空', trigger: ['blur', 'change'] }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'input',
|
|
|
+ itemType: 'textarea',
|
|
|
+ prop: 'remark',
|
|
|
+ label: '摘要',
|
|
|
+ rows: 5,
|
|
|
+ span: 24
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'upload',
|
|
|
+ prop: 'atts',
|
|
|
+ label: '附件',
|
|
|
+ span: 24
|
|
|
}
|
|
|
]
|
|
|
|
|
@@ -263,39 +337,11 @@ function tableSelectionChange(item: StrAnyObjArr) {
|
|
|
|
|
|
function formSubmit() {
|
|
|
formRef.value?.validate(() => {
|
|
|
- if (formData.value.paymentRequestsDetailList.length === 0) {
|
|
|
- ElMessage.error('请款明细为空,无法提交')
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- for (const item of formData.value.paymentRequestsDetailList) {
|
|
|
- if (!item.expenseType) {
|
|
|
- ElMessage.error('请款明细存在费用类型为空,无法提交')
|
|
|
- return
|
|
|
- }
|
|
|
- if (!item.remark) {
|
|
|
- ElMessage.error('请款明细存在款项说明为空,无法提交')
|
|
|
- return
|
|
|
- }
|
|
|
- if (!item.amount) {
|
|
|
- ElMessage.error('请款明细存在请款金额为空,无法提交')
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (formData.value.id) {
|
|
|
- editApi(formData.value).then(() => {
|
|
|
- dialogVisible.value = false
|
|
|
- ElMessage.success('修改成功')
|
|
|
- getPage()
|
|
|
- })
|
|
|
- } else {
|
|
|
- addApi(formData.value).then(() => {
|
|
|
- dialogVisible.value = false
|
|
|
- ElMessage.success('新增成功')
|
|
|
- getPage()
|
|
|
- })
|
|
|
- }
|
|
|
+ remitApi(formData.value).then(() => {
|
|
|
+ dialogVisible.value = false
|
|
|
+ ElMessage.success('打款成功')
|
|
|
+ getPage()
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -309,7 +355,7 @@ function formClosed() {
|
|
|
<el-card v-if="showQuery">
|
|
|
<a-form ref="queryRef" v-model="queryData" :config="queryConfig" :span="6">
|
|
|
<template #deptId>
|
|
|
- <dept-tree-select ref="selectDeptIdRef" v-model="formData.deptId" />
|
|
|
+ <dept-tree-select ref="selectDeptIdRef" v-model="queryData.deptId" />
|
|
|
</template>
|
|
|
</a-form>
|
|
|
</el-card>
|
|
@@ -336,14 +382,16 @@ function formClosed() {
|
|
|
width="1400px"
|
|
|
>
|
|
|
<div v-if="disabled">
|
|
|
- <a-form ref="formRef" v-model="formData" :config="formConfig" :span="12" disabled></a-form>
|
|
|
+ <a-form v-model="detailData" :config="detailConfig" :span="12" disabled> </a-form>
|
|
|
</div>
|
|
|
|
|
|
<el-card v-if="!disabled" header="请款信息">
|
|
|
- <a-form ref="formRef" v-model="formData" :config="formConfig" :span="12"></a-form>
|
|
|
+ <a-form v-model="detailData" :config="detailConfig" :span="12" disabled></a-form>
|
|
|
</el-card>
|
|
|
|
|
|
- <el-card v-if="!disabled" header="打款信息" style="margin-top: 10px"> </el-card>
|
|
|
+ <el-card v-if="!disabled" header="打款信息" style="margin-top: 10px">
|
|
|
+ <a-form ref="formRef" v-model="formData" :config="formConfig" :span="12"> </a-form>
|
|
|
+ </el-card>
|
|
|
</a-dialog>
|
|
|
</div>
|
|
|
</template>
|