|
|
@@ -16,14 +16,16 @@
|
|
|
<el-option value="orderType" label="订单类型"></el-option>
|
|
|
<el-option value="signYear" label="签单年份"></el-option>
|
|
|
</el-select>
|
|
|
- <el-select v-model="item.type" v-if="item.name != 'signDate'" style="margin-right: 20px; width: 150px" @change="val=>signDateSelectChange(index, val)">
|
|
|
+ <el-select v-model="item.type" v-if="item.name != 'signDate'" style="margin-right: 20px; width: 150px"
|
|
|
+ @change="val => signDateSelectChange(index, val)">
|
|
|
<el-option value="等于" label="等于"></el-option>
|
|
|
<el-option value="不等于" label="不等于"></el-option>
|
|
|
<el-option value="包含" label="包含"></el-option>
|
|
|
<el-option value="不包含" label="不包含"></el-option>
|
|
|
<el-option value="为空" label="为空"></el-option>
|
|
|
</el-select>
|
|
|
- <el-select v-model="item.type" v-else style="margin-right: 20px; width: 150px" @change="val=>signDateSelectChange(index, val)">
|
|
|
+ <el-select v-model="item.type" v-else style="margin-right: 20px; width: 150px"
|
|
|
+ @change="val => signDateSelectChange(index, val)">
|
|
|
<el-option value="大于等于" label="大于等于"></el-option>
|
|
|
<el-option value="小于等于" label="小于等于"></el-option>
|
|
|
<el-option value="固定范围" label="固定范围"></el-option>
|
|
|
@@ -36,10 +38,11 @@
|
|
|
</el-select>
|
|
|
<el-date-picker style="width: 350px" v-model="datesearch" v-if="item.name == 'signDate'"
|
|
|
:type="item.type == '大于等于' || item.type == '小于等于' ? 'date' : 'daterange'" placeholder="请选择"
|
|
|
- :disabled="item.type == '为空'" @change="handlePtlAgreementChange(index, $event)" value-format="YYYY-MM-DD" />
|
|
|
- <el-select style="width: 350px" v-model="multipleSearch" v-if="item.name == 'ptlAgreement'" multiple filterable
|
|
|
- :disabled="item.type == '为空'" @change="handlePtlAgreementChange(index, $event)">
|
|
|
- <el-option v-for="item in insurerContract" :key="item.id" :value="item.id" :label="item.agreementName" ></el-option>
|
|
|
+ :disabled="item.type == '为空'" @change="handlePtlAgreementChange(index, $event)" value-format="YYYY-MM-DD" />
|
|
|
+ <el-select style="width: 350px" v-model="multipleSearch" v-if="item.name == 'ptlAgreement'" multiple
|
|
|
+ filterable :disabled="item.type == '为空'" @change="handlePtlAgreementChange(index, $event)">
|
|
|
+ <el-option v-for="item in insurerContract" :key="item.id" :value="item.id"
|
|
|
+ :label="item.agreementName"></el-option>
|
|
|
</el-select>
|
|
|
<el-select style="width: 350px" v-model="orderTypesearch" v-if="item.name == 'orderType'" multiple
|
|
|
:disabled="item.type == '为空'" @change="handlePtlAgreementChange(index, $event)">
|
|
|
@@ -47,9 +50,9 @@
|
|
|
<el-option value="2" label="代客录单"></el-option>
|
|
|
<el-option value="3" label="补录订单"></el-option>
|
|
|
</el-select>
|
|
|
- <el-date-picker v-if="item.name == 'signYear'" style="width: 350px" format="YYYY"
|
|
|
- value-format="YYYY" v-model="yearrangesearch" type="yearrange"
|
|
|
- range-separator="-" :disabled="item.type == '为空'" @change="handlePtlAgreementChange(index, $event)" />
|
|
|
+ <el-date-picker v-if="item.name == 'signYear'" style="width: 350px" format="YYYY" value-format="YYYY"
|
|
|
+ v-model="yearrangesearch" type="yearrange" range-separator="-" :disabled="item.type == '为空'"
|
|
|
+ @change="handlePtlAgreementChange(index, $event)" />
|
|
|
<!-- <el-icon style="margin-left: 20px; cursor:pointer;"><CircleClose /></el-icon> -->
|
|
|
</div>
|
|
|
<el-button type="primary" @click="handleSearch">搜索</el-button>
|
|
|
@@ -87,8 +90,7 @@
|
|
|
</el-table>
|
|
|
<div class="footer">
|
|
|
<el-button plain @click="handleBack">取消</el-button>
|
|
|
- <el-button plain type="primary" @click="handleTicket">开票并结算</el-button>
|
|
|
- <el-button type="primary" @click="handleInvoice">开票</el-button>
|
|
|
+ <el-button type="primary" @click="handleSettlement">结算</el-button>
|
|
|
</div>
|
|
|
<el-dialog v-model="addShow" width="800" title="添加应收">
|
|
|
<div class="add-content">
|
|
|
@@ -147,26 +149,20 @@
|
|
|
<el-button type="primary" @click="handleAddSubmit">确定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
- <el-dialog v-model="countShow" width="600" title="开票并结算">
|
|
|
- <el-form ref="CountForm" :model="countForm" :rules="countRules" label-width="120">
|
|
|
- <el-form-item prop="invoiceParty" label="开票方">
|
|
|
- <el-input v-model="countForm.invoiceParty" placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="receivableSupervisePremium" label="应收手续费">
|
|
|
- <el-input v-model="countForm.receivableSupervisePremium" placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="overinflatedAmount" label="虚增金额">
|
|
|
- <el-input v-model="countForm.overinflatedAmount" placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="taxPoint" label="税点">
|
|
|
- <el-input v-model="countForm.taxPoint" placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="receivableSupervisePremium" label="应收金额">
|
|
|
- <el-input v-model="countForm.receivableSupervisePremium" placeholder="请输入"></el-input>
|
|
|
+ <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" />
|
|
|
@@ -194,10 +190,12 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
- <el-button class="border-[#0083FF] color-[#0083FF]" plain @click="handelCancel">取消</el-button>
|
|
|
- <el-button type="primary" @click="handelComfirm(CountForm)">确定</el-button>
|
|
|
+ <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>
|
|
|
</template>
|
|
|
|
|
|
@@ -205,10 +203,12 @@
|
|
|
import api from '@/api'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
-import { ElMessage } from "element-plus";
|
|
|
+import { ElMessage, FormInstance } from "element-plus";
|
|
|
|
|
|
let route = useRoute()
|
|
|
let router = useRouter()
|
|
|
+const CountFormRef = ref<FormInstance>()
|
|
|
+
|
|
|
const selectedList = ref([])//选中的应收单据
|
|
|
const companyList = ref()//保险公司
|
|
|
const insurerContract = ref()//保险公司协议
|
|
|
@@ -216,8 +216,31 @@ const multipleSearch = ref('')
|
|
|
const orderTypesearch = ref('')
|
|
|
const yearrangesearch = ref('')
|
|
|
const datesearch = ref('')
|
|
|
-const countShow = ref(false)
|
|
|
-const countForm = ref({})
|
|
|
+const countForm = ref({
|
|
|
+ invoicingId: '',
|
|
|
+ actualReceivedAmount: '',
|
|
|
+ paymentDifference: '',
|
|
|
+ paymentReason: '',
|
|
|
+ receivePaymentDate: '',
|
|
|
+ attachmentIds: [],
|
|
|
+})
|
|
|
+ const receivablePremium= ref('')
|
|
|
+
|
|
|
+const settlementDialog = ref(false)//结算弹窗
|
|
|
+let settlementRules = ref({
|
|
|
+ actualReceivedAmount: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
+ 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([])
|
|
|
+
|
|
|
//获取保险公司协议
|
|
|
const getByCompanyId = () => {
|
|
|
api.dispatchApi.getByCompanyIdt(route.query.id).then((res: any) => {
|
|
|
@@ -256,9 +279,8 @@ if (route.query) {
|
|
|
console.log(route.query)
|
|
|
|
|
|
selectedList.value = JSON.parse(route.query.selectedList || '[]')
|
|
|
- searchList.value[0].search = route.query.id
|
|
|
+ searchList.value[0].search = route.query.companyId || ''
|
|
|
getByCompanyId()
|
|
|
- console.log(selectedList.value)
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -307,21 +329,21 @@ const handlePtlAgreementChange = (index: any, e: any) => {
|
|
|
console.log(e)
|
|
|
if (Array.isArray(e)) {
|
|
|
searchList.value[index].search = e.join(',') || ''
|
|
|
- }else{
|
|
|
- searchList.value[index].search = e|| ''
|
|
|
+ } else {
|
|
|
+ searchList.value[index].search = e || ''
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 签单时间选择器改变时触发
|
|
|
-const signDateSelectChange = (index:any,e:any) => {
|
|
|
+const signDateSelectChange = (index: any, e: any) => {
|
|
|
switch (e) {
|
|
|
case '为空':
|
|
|
searchList.value[index].search = ''
|
|
|
break;
|
|
|
case '大于等于':
|
|
|
case '小于等于':
|
|
|
- searchList.value[index].search = ''
|
|
|
- datesearch.value = ''
|
|
|
+ searchList.value[index].search = ''
|
|
|
+ datesearch.value = ''
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -364,81 +386,77 @@ const handleToAdd = (row) => {
|
|
|
selectedData.value.push(row)
|
|
|
}
|
|
|
}
|
|
|
- // ElMessage({
|
|
|
- // message: '该订单已被xxx添加到应收开票中',
|
|
|
- // type: 'warning'
|
|
|
- // })
|
|
|
+
|
|
|
+}
|
|
|
+let imageShow = ref(false)
|
|
|
+let bigImageUrl = ref('')
|
|
|
+const handelViewImage = (item, index) => {
|
|
|
+ bigImageUrl.value = item
|
|
|
+ imageShow.value = true
|
|
|
+}
|
|
|
+const handelDelImage = (item, index) => {
|
|
|
+ imageUrl.value.splice(index, 1)
|
|
|
+ countForm.value.attachmentIds.splice(index, 1)
|
|
|
}
|
|
|
|
|
|
// 开票并结算
|
|
|
const handleBack = () => {
|
|
|
router.back()
|
|
|
}
|
|
|
-const handleTicket = () => {
|
|
|
-
|
|
|
- api.financeApi.invoicingCheck({
|
|
|
- incomeIds: selectedList.value.map(v => v.id),
|
|
|
- companyId: route.query.id,
|
|
|
- invoiceType: route.query.invoiceType
|
|
|
+const handleSettlement = () => {
|
|
|
+ // 查应收金额
|
|
|
+ api.financeApi.getPlatformSettlementReceivableAmount({
|
|
|
+ invoiceType: "5",
|
|
|
+ orderNos: selectedList.value.map(item => item.orderNo),
|
|
|
}).then((res: any) => {
|
|
|
if (res.code == 200) {
|
|
|
- countShow.value = true
|
|
|
- api.financeApi.commissionInvoicing({
|
|
|
- incomeIds: selectedList.value.map(v => v.id),
|
|
|
- orderNos: selectedList.value.map(v => v.orderNo),
|
|
|
- companyId: route.query.id,
|
|
|
- invoiceType: route.query.invoiceType
|
|
|
- }).then((sub: any) => {
|
|
|
- if (sub.code == 200) {
|
|
|
- ElMessage({
|
|
|
- message: sub.msg,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- api.financeApi.settlement({
|
|
|
- invoicingId: sub.data.invoiceId,
|
|
|
- actualReceivedAmount: sub.data.sumPrice
|
|
|
- }).then((msg: any) => {
|
|
|
- if (msg.code == 200) {
|
|
|
- ElMessage({
|
|
|
- message: msg.msg,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }else{
|
|
|
-
|
|
|
+ receivablePremium.value = res.data
|
|
|
}
|
|
|
})
|
|
|
+ settlementDialog.value = true
|
|
|
}
|
|
|
-const handleInvoice = () => {
|
|
|
- api.financeApi.invoicingCheck({
|
|
|
- incomeIds: selectedList.value.map(v => v.id),
|
|
|
- companyId: route.query.id,
|
|
|
- invoiceType: route.query.invoiceType
|
|
|
- }).then((res: any) => {
|
|
|
- if (res.code == 200) {
|
|
|
- api.financeApi.commissionInvoicing({
|
|
|
- incomeIds: selectedList.value.map(v => v.id),
|
|
|
- orderNos: selectedList.value.map(v => v.orderNo),
|
|
|
- companyId: route.query.id,
|
|
|
- invoiceType: route.query.invoiceType
|
|
|
- }).then((sub: any) => {
|
|
|
- if (sub.code == 200) {
|
|
|
+const handelComfirm = (formEl: FormInstance | undefined) => {
|
|
|
+ if (!formEl) return
|
|
|
+ formEl.validate((valid) => {
|
|
|
+ console.log(countForm.value)
|
|
|
+ if (valid) {
|
|
|
+ api.financeApi.platformSettlement({
|
|
|
+ settlementVo: countForm.value,
|
|
|
+ invoicingVo: {
|
|
|
+ incomeIds: selectedList.value.map(item => item.id),
|
|
|
+ orderNos: selectedList.value.map(item => item.orderNo),
|
|
|
+ companyId: route.query.companyId,
|
|
|
+ receivablePremium: receivablePremium.value,
|
|
|
+ invoiceType: "5"
|
|
|
+ }
|
|
|
+
|
|
|
+ }).then((res: any) => {
|
|
|
+ if (res.code == 200) {
|
|
|
ElMessage({
|
|
|
- message: sub.msg,
|
|
|
+ message: res.msg,
|
|
|
type: 'success'
|
|
|
})
|
|
|
+ settlementDialog.value = false
|
|
|
+ } else {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+const uploadImage = async (file, fileList) => {
|
|
|
+ let files = file.raw
|
|
|
+ const params = new FormData(); // 声明formData数据类型
|
|
|
+ params.append("file", files);
|
|
|
+ params.append("type", "image");
|
|
|
+ const { code, data, msg } = await api.commonApi.fileUpload(params)
|
|
|
+ if (code == 200) {
|
|
|
+ imageUrl.value.push(data.downloadUrl)
|
|
|
+ countForm.value.attachmentIds.push(data.id)
|
|
|
+ }
|
|
|
+}
|
|
|
const initData = () => {
|
|
|
// router
|
|
|
- api.financeApi.getSelectedReceivableList({ orderNos: selectedList.value.map(v => v.orderNo),companyId: route.query.id}).then((res: any) => {
|
|
|
+ api.financeApi.getSelectedReceivableList({ orderNos: selectedList.value.map(v => v.orderNo), companyId: route.query.id }).then((res: any) => {
|
|
|
if (res.code == 200) {
|
|
|
tableData.value = res.data
|
|
|
}
|
|
|
@@ -506,7 +524,7 @@ onMounted(() => {
|
|
|
|
|
|
.footer {
|
|
|
width: 100%;
|
|
|
- position: fixed;
|
|
|
+ position: absolute;
|
|
|
left: 0;
|
|
|
bottom: 0;
|
|
|
display: flex;
|
|
|
@@ -515,4 +533,59 @@ onMounted(() => {
|
|
|
height: 80px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.imageDiv {
|
|
|
+ position: relative;
|
|
|
+ width: 80px;
|
|
|
+ height: 80px;
|
|
|
+ margin: 0 10px 10px 0;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ .model {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background-color: rgba(0, 0, 0, .3);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ img {
|
|
|
+ display: block;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .model {
|
|
|
+ position: absolute;
|
|
|
+ width: 80px;
|
|
|
+ height: 80px;
|
|
|
+ border-radius: 4px;
|
|
|
+ display: none;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+
|
|
|
+ .icon-view,
|
|
|
+ .icon-del {
|
|
|
+ color: #FFFFFF;
|
|
|
+ margin: 0 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.upload-btn {
|
|
|
+ :deep(.el-button) {
|
|
|
+ width: 80px;
|
|
|
+ height: 80px;
|
|
|
+ font-size: 30px;
|
|
|
+ color: #ccc;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-upload-dragger) {
|
|
|
+ padding: unset;
|
|
|
+ border: unset;
|
|
|
+ border-radius: unset;
|
|
|
+}
|
|
|
</style>
|