|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="ticket">
|
|
|
+ <div class="ticket" v-if="showTicket">
|
|
|
<div class="search-list">
|
|
|
<div class="search-left">
|
|
|
<el-select v-model="logicJudge">
|
|
|
@@ -149,54 +149,56 @@
|
|
|
<el-button type="primary" @click="handleAddSubmit">确定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
- <el-dialog v-model="settlementDialog" width="600" title="结算">
|
|
|
- <el-form ref="CountFormRef" :model="countForm" :rules="settlementRules" label-width="120">
|
|
|
- <el-form-item label="应收金额">
|
|
|
- <el-input v-model="receivablePremium" placeholder="请输入" disabled></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="actualReceivedAmount" label="实收金额">
|
|
|
- <el-input v-model="countForm.actualReceivedAmount" placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="paymentDifference" label="回款金额">
|
|
|
- <el-input v-model="countForm.paymentDifference" placeholder="请输入" disabled></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="paymentReason" label="差额原因">
|
|
|
- <el-input v-model="countForm.paymentReason" placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="receivePaymentDate" label="收款日期">
|
|
|
- <el-date-picker v-model="countForm.receivePaymentDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
- format="YYYY-MM-DD HH:mm:ss" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="attachmentIds" label="收款凭证" class="upload-btn">
|
|
|
- <el-upload style="margin: 0 10px 10px 0" :auto-upload="false" multiple v-if="!countForm.h"
|
|
|
- :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage" drag>
|
|
|
- <el-button size="large" icon="Plus" />
|
|
|
- </el-upload>
|
|
|
- <div class="imageDiv" v-for="(item, index) in imageUrl" :key="item">
|
|
|
- <img :src="item" />
|
|
|
- <div class="model">
|
|
|
- <span class="icon-view" @click="handelViewImage(item, index)">
|
|
|
- <el-icon>
|
|
|
- <View />
|
|
|
- </el-icon>
|
|
|
- </span>
|
|
|
- <span class="icon-del" @click="handelDelImage(item, index)">
|
|
|
- <el-icon>
|
|
|
- <Delete />
|
|
|
- </el-icon>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <template #footer>
|
|
|
- <el-button class="border-[#0083FF] color-[#0083FF]" plain @click="settlementDialog = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="handelComfirm(CountFormRef)">确定结算</el-button>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
+
|
|
|
<el-image-viewer v-if="imageShow" :url-list="[bigImageUrl]" @close="imageShow = false" />
|
|
|
|
|
|
</div>
|
|
|
+ <el-dialog v-model="settlementDialog" width="600" title="结算">
|
|
|
+ <el-form ref="CountFormRef" :model="countForm" :rules="settlementRules" label-width="120">
|
|
|
+ <el-form-item label="应收金额">
|
|
|
+ <el-input v-model="receivablePremium" placeholder="请输入" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="actualReceivedAmount" label="实收金额">
|
|
|
+ <el-input-number v-model="countForm.actualReceivedAmount" style="width: 100%;" :min="0" :precision="4"
|
|
|
+ controls-position="right" @change="handleChange" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="paymentDifference" label="回款金额">
|
|
|
+ <el-input v-model="countForm.paymentDifference" placeholder="请输入" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="paymentReason" label="差额原因">
|
|
|
+ <el-input v-model="countForm.paymentReason" placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="receivePaymentDate" label="收款日期">
|
|
|
+ <el-date-picker v-model="countForm.receivePaymentDate" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ format="YYYY-MM-DD HH:mm:ss" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="attachmentIds" label="收款凭证" class="upload-btn">
|
|
|
+ <el-upload style="margin: 0 10px 10px 0" :auto-upload="false" multiple v-if="!countForm.h"
|
|
|
+ :show-file-list="false" accept=".png, .jpg, .jpeg" @change="uploadImage" drag>
|
|
|
+ <el-button size="large" icon="Plus" />
|
|
|
+ </el-upload>
|
|
|
+ <div class="imageDiv" v-for="(item, index) in imageUrl" :key="item">
|
|
|
+ <img :src="item" />
|
|
|
+ <div class="model">
|
|
|
+ <span class="icon-view" @click="handelViewImage(item, index)">
|
|
|
+ <el-icon>
|
|
|
+ <View />
|
|
|
+ </el-icon>
|
|
|
+ </span>
|
|
|
+ <span class="icon-del" @click="handelDelImage(item, index)">
|
|
|
+ <el-icon>
|
|
|
+ <Delete />
|
|
|
+ </el-icon>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <el-button class="border-[#0083FF] color-[#0083FF]" plain @click="settlementDialog = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="handelComfirm(CountFormRef)">确定结算</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
@@ -224,7 +226,7 @@ const countForm = ref({
|
|
|
receivePaymentDate: '',
|
|
|
attachmentIds: [],
|
|
|
})
|
|
|
- const receivablePremium= ref('')
|
|
|
+const receivablePremium = ref('')
|
|
|
|
|
|
const settlementDialog = ref(false)//结算弹窗
|
|
|
let settlementRules = ref({
|
|
|
@@ -232,13 +234,7 @@ let settlementRules = ref({
|
|
|
receivePaymentDate: [{ required: true, trigger: "change", message: "请选择" }],
|
|
|
attachmentIds: [{ required: true, message: "请上传" }]
|
|
|
})
|
|
|
-watch(
|
|
|
- () => [countForm.value.actualReceivedAmount, receivablePremium.value],
|
|
|
- ([actual, receivable]) => {
|
|
|
- countForm.value.paymentDifference = Number(actual) - Number(receivable)
|
|
|
- },
|
|
|
- { immediate: true }
|
|
|
-)
|
|
|
+
|
|
|
let imageUrl = ref([])
|
|
|
|
|
|
//获取保险公司协议
|
|
|
@@ -275,12 +271,17 @@ let searchList = ref([
|
|
|
search: ''
|
|
|
}
|
|
|
])
|
|
|
-if (route.query) {
|
|
|
+const showTicket = ref(false)
|
|
|
+const companyId = ref('')
|
|
|
+if (route.query?.companyId) {
|
|
|
console.log(route.query)
|
|
|
-
|
|
|
+ showTicket.value = true
|
|
|
selectedList.value = JSON.parse(route.query.selectedList || '[]')
|
|
|
searchList.value[0].search = route.query.companyId || ''
|
|
|
+ companyId.value = route.query.companyId || ''
|
|
|
getByCompanyId()
|
|
|
+} else {
|
|
|
+ showTicket.value = false
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -425,7 +426,7 @@ const handelComfirm = (formEl: FormInstance | undefined) => {
|
|
|
invoicingVo: {
|
|
|
incomeIds: selectedList.value.map(item => item.id),
|
|
|
orderNos: selectedList.value.map(item => item.orderNo),
|
|
|
- companyId: route.query.companyId,
|
|
|
+ companyId: companyId.value,
|
|
|
receivablePremium: receivablePremium.value,
|
|
|
invoiceType: "5"
|
|
|
}
|
|
|
@@ -471,6 +472,32 @@ const initCompany = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const handleChange = async () => {
|
|
|
+ const num = await calSub(receivablePremium.value, countForm.value.actualReceivedAmount)
|
|
|
+ countForm.value.paymentDifference = num
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 计算两个数值的差值(被减数 - 减数)
|
|
|
+ * @param minuend 被减数
|
|
|
+ * @param subtrahend 减数
|
|
|
+ * @returns 差值,若接口无数据则返回 0
|
|
|
+ */
|
|
|
+const calSub = async (minuend:number, subtrahend:number) => {
|
|
|
+ const res = await api.financeApi.calSub({ minuend, subtrahend })
|
|
|
+ return res.data || 0
|
|
|
+}
|
|
|
+
|
|
|
+const openSettlement = (list,id) => {
|
|
|
+ companyId.value = id
|
|
|
+ selectedList.value = list
|
|
|
+ handleSettlement()
|
|
|
+}
|
|
|
+
|
|
|
+defineExpose({
|
|
|
+ openSettlement,
|
|
|
+});
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
initData()
|
|
|
initCompany()
|