|
|
@@ -22,8 +22,9 @@
|
|
|
filterable :disabled="item.type == '为空'">
|
|
|
<el-option v-for="item in companyList" :key="item.id" :value="item.id" :label="item.name"></el-option>
|
|
|
</el-select> -->
|
|
|
- <el-cascader class="w-350px" filterable clearable :disabled="item.type == '为空'" v-if="item.name == 'companyId'" placeholder="请选择" v-model="item.search" :options="companyList"
|
|
|
- :props="companyIdprops" @change="handleCompanyChange(index, $event)" />
|
|
|
+ <el-cascader class="w-350px" filterable clearable :disabled="item.type == '为空'"
|
|
|
+ v-if="item.name == 'companyId'" placeholder="请选择" v-model="item.search" :options="companyList"
|
|
|
+ :props="companyIdprops" @change="handleCompanyChange(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)" />
|
|
|
@@ -39,9 +40,19 @@
|
|
|
<el-table-column prop="year" label="年"></el-table-column>
|
|
|
<el-table-column prop="month" label="月"></el-table-column>
|
|
|
<el-table-column prop="receivablePremium" label="应收总额"></el-table-column>
|
|
|
- <el-table-column prop="receivablePremium" label="对账金额"></el-table-column>
|
|
|
- <el-table-column prop="receivablePremium" label="虚增金额"></el-table-column>
|
|
|
- <el-table-column prop="receivablePremium" label="虚增金额原因"></el-table-column>
|
|
|
+ <el-table-column prop="reconciliationAmount" label="对账金额">
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="flex items-center" @click="handleEdit(scope.row)" @mouseenter="scope.row.showEdit = true"
|
|
|
+ @mouseleave="scope.row.showEdit = false">
|
|
|
+ ¥{{ scope.row.reconciliationAmount || 0 }}
|
|
|
+ <el-icon class="m-l-4px " v-if="scope.row.showEdit">
|
|
|
+ <Edit />
|
|
|
+ </el-icon>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="falselyIncreasedDifference" label="虚增金额"></el-table-column>
|
|
|
+ <el-table-column prop="falselyIncreasedReason" label="虚增金额原因"></el-table-column>
|
|
|
<el-table-column prop="invoiced" label="已开票"></el-table-column>
|
|
|
<el-table-column prop="uninvoiced" label="未开票"></el-table-column>
|
|
|
</el-table>
|
|
|
@@ -111,6 +122,27 @@
|
|
|
<el-button type="primary" @click="handelComfirm()">确定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog :close-on-click-modal="false" v-model="editShow" width="600" :title="isSettlement ? '开票并结算' : '开票'">
|
|
|
+ <el-form ref="CountForm" :model="editForm" :rules="countRules" label-width="120">
|
|
|
+ <el-form-item prop="receivableSupervisePremium" label="应收金额">
|
|
|
+ <el-input v-model="editForm.receivablePremium" placeholder="请输入" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="reconciliationAmount" label="对账金额">
|
|
|
+ <el-input-number :disabled="editForm.invoiced" v-model="editForm.reconciliationAmount"
|
|
|
+ style="width: 100%;" :min="0" :precision="2" controls-position="right" @change="handleChange2()" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="falselyIncreasedDifference" label="虚增金额">
|
|
|
+ <el-input v-model="editForm.falselyIncreasedDifference" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="falselyIncreasedReason" label="虚增金额原因">
|
|
|
+ <el-input v-model="editForm.falselyIncreasedReason" placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <el-button class="border-[#0083FF] color-[#0083FF]" plain @click="editShow = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="editShow = false">确定</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -119,9 +151,7 @@ import api from '@/api'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
import { ElMessage } from "element-plus";
|
|
|
-import { getLeft } from '@imengyu/vue3-context-menu/lib/ContextMenuUtils';
|
|
|
|
|
|
-let route = useRoute()
|
|
|
let router = useRouter()
|
|
|
const selectedList = ref([])//选中的应收单据
|
|
|
const companyList = ref()//保险公司
|
|
|
@@ -130,11 +160,17 @@ const yearrangesearch = ref([year, year])
|
|
|
|
|
|
const countShow = ref(false)
|
|
|
const countForm = ref({})
|
|
|
+const editShow = ref(false)
|
|
|
+const editForm = ref({})
|
|
|
+const handleEdit = (row) => {
|
|
|
+ editShow.value = true
|
|
|
+ editForm.value = row
|
|
|
+}
|
|
|
const companyIdprops = {
|
|
|
- expandTrigger: 'hover' as const,
|
|
|
- value: 'id',
|
|
|
- label: 'name',
|
|
|
- checkStrictly: true,
|
|
|
+ expandTrigger: 'hover' as const,
|
|
|
+ value: 'id',
|
|
|
+ label: 'name',
|
|
|
+ checkStrictly: true,
|
|
|
}
|
|
|
const tableRef = ref('')
|
|
|
|
|
|
@@ -222,12 +258,18 @@ const handleTicket = async (bool: boolean) => {
|
|
|
ElMessage.error('请选择应收单据')
|
|
|
return
|
|
|
}
|
|
|
+ if (selectedList.value.find(v=>v.reconciliationAmount===undefined)) {
|
|
|
+ ElMessage.error('请先确认对账金额')
|
|
|
+ return
|
|
|
+ }
|
|
|
isSettlement.value = bool
|
|
|
const arr = selectedList.value.map(v => v.uninvoiced)
|
|
|
const res = await api.financeApi.calculateTotalSum(arr.join())
|
|
|
if (res.code == 200) {
|
|
|
openCountForm()
|
|
|
countForm.value.companyId = selectedList.value[0].companyId
|
|
|
+ countForm.value.reconciliationAmount = selectedList.value.reduce((total, current) => total + current.reconciliationAmount, 0);
|
|
|
+ console.log("🚀 ~ handleTicket ~ countForm.value.reconciliationAmount:", countForm.value.reconciliationAmount)
|
|
|
receivableSupervisePremium.value = res.data
|
|
|
if (selectedList.value.length > 1) countForm.value.receivableSupervisePremium = res.data
|
|
|
if (selectedList.value.length === 1) countForm.value.selectFlag = 0
|
|
|
@@ -247,6 +289,11 @@ const handleChange1 = async () => {
|
|
|
countForm.value.overinflatedAmount = num
|
|
|
}
|
|
|
|
|
|
+const handleChange2 = async () => {
|
|
|
+ const num = await calSub(editForm.value.reconciliationAmount, editForm.value.receivablePremium)
|
|
|
+ editForm.value.falselyIncreasedDifference = num
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 计算两个数值的差值(被减数 - 减数)
|
|
|
* @param minuend 被减数
|
|
|
@@ -265,6 +312,14 @@ const openCountForm = () => {
|
|
|
countShow.value = true
|
|
|
}
|
|
|
const handelComfirm = () => {
|
|
|
+ if(countForm.value.reconciliationAmount<countForm.value.receivableSupervisePremium){
|
|
|
+ ElMessage.error('开票金额不可大于对账金额')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(countForm.value.receivableSupervisePremium===0){
|
|
|
+ ElMessage.error('开票金额不能为0')
|
|
|
+ return
|
|
|
+ }
|
|
|
const attachmentIds = countForm.value.attachmentIds?.map(v => v.response.data.id)
|
|
|
let params: any = {
|
|
|
details: selectedList.value,
|