Просмотр исходного кода

开票限制,不允许不同公司一起开票

祁鹏飞 2 месяцев назад
Родитель
Сommit
18c31f8ba3
2 измененных файлов с 28 добавлено и 14 удалено
  1. 0 2
      src/views/receivable/handingFee/index.vue
  2. 28 12
      src/views/receivable/handingFee/ticket.vue

+ 0 - 2
src/views/receivable/handingFee/index.vue

@@ -160,8 +160,6 @@
           </span>
           <span>应收金额总计:¥{{ receivedAmountTotal || 0 }}</span>
         </el-row>
-
-
         <el-table :data="receiveData" :height="isTrue ? 'calc(100% - 414px)' : 'calc(100% - 264px)'"
           style="width: 100%; margin-top: 20px;" row-key="id" ref="ReceiveDataRef1" @select="handleSelectChange1"
           @select-all="handleSelectAll1" highlight-current-row>

+ 28 - 12
src/views/receivable/handingFee/ticket.vue

@@ -59,7 +59,7 @@
           <el-input v-if="item.name == 'licenseNo' || item.name == 'jqPolicyNo' || item.name == 'syPolicyNo'"
             placeholder="请输入" style="width: 350px" v-model="item.search" />
         </div>
-      <el-button type="primary" class="w-88px" @click="handleSearch">搜索</el-button>
+        <el-button type="primary" class="w-88px" @click="handleSearch">搜索</el-button>
 
       </div>
 
@@ -69,7 +69,7 @@
       <el-button type="primary" @click="addTicket">添加应收</el-button>
     </div>
     <el-table :data="tableData" style="height: calc(100% - 300px)" show-summary
-    :summary-method="val => getSummaries(val,['jqPremium','jqSuperviseCostsProportion','syPremium','sySuperviseCostsProportion','receivableAmount','receivableAmount4Car','receivableAmount4Other'])">
+      :summary-method="val => getSummaries(val, ['jqPremium', 'jqSuperviseCostsProportion', 'syPremium', 'sySuperviseCostsProportion', 'receivableAmount', 'receivableAmount4Car', 'receivableAmount4Other'])">
       <template #empty>
         <div v-if="noData">暂无应收,点击<el-button link type="primary" @click="batchShow = true">导入应收</el-button></div>
         <div v-else>没有符合的应收单据~</div>
@@ -90,14 +90,15 @@
       <el-table-column prop="sySuperviseCostsProportion" label="商业险手续费比例"></el-table-column>
       <el-table-column prop="receivableAmount" label="总应收"></el-table-column>
       <el-table-column v-if="route.query.invoiceType == '1'" prop="receivableAmount4Car" label="车险应收"></el-table-column>
-      <el-table-column v-if="route.query.invoiceType == '3'" prop="receivableAmount4Other" label="非车险应收"></el-table-column>
+      <el-table-column v-if="route.query.invoiceType == '3'" prop="receivableAmount4Other"
+        label="非车险应收"></el-table-column>
     </el-table>
     <div class="footer">
       <el-button plain @click="handleBack">取消</el-button>
       <el-button plain type="primary" @click="handleTicket(true)">开票并结算</el-button>
       <el-button type="primary" @click="handleTicket(false)">开票</el-button>
     </div>
-    <el-dialog :close-on-click-modal="false"  v-model="addShow" width="800" title="添加应收">
+    <el-dialog :close-on-click-modal="false" v-model="addShow" width="800" title="添加应收">
       <div class="add-content">
         <el-input v-model="addSearchValue" style="max-width: 500px" :placeholder="`请输入${placeholder}`"
           class="input-with-select">
@@ -154,8 +155,9 @@
         <el-button type="primary" @click="handleAddSubmit">确定</el-button>
       </template>
     </el-dialog>
-    <el-dialog :close-on-click-modal="false" v-model="countShow" width="600" :title="isSettlement ? '开票并结算' : '开票'" top="1vh">
-      <el-form ref="CountForm" :model="countForm" :rules="countRules" label-width="120" >
+    <el-dialog :close-on-click-modal="false" v-model="countShow" width="600" :title="isSettlement ? '开票并结算' : '开票'"
+      top="1vh">
+      <el-form ref="CountForm" :model="countForm" :rules="countRules" label-width="120">
         <el-form-item prop="invoiceParty" label="开票方">
           <el-select v-model="countForm.invoiceParty" placeholder="请选择开票方">
             <el-option label="我方开票" value="1"></el-option>
@@ -172,12 +174,12 @@
           <el-input v-model="receivableSupervisePremium" placeholder="请输入" disabled></el-input>
         </el-form-item>
         <el-form-item prop="receivableSupervisePremium" label="开票金额">
-          <el-input-number v-model="countForm.receivableSupervisePremium" style="width: 100%;" :min="0" :max="1111111111111" :precision="2"
-            controls-position="right" @change="handleChange();handleChange1()" />
+          <el-input-number v-model="countForm.receivableSupervisePremium" style="width: 100%;" :min="0"
+            :max="1111111111111" :precision="2" controls-position="right" @change="handleChange(); handleChange1()" />
         </el-form-item>
         <el-form-item v-if="isSettlement" prop="actualReceivedAmount" label="实收金额">
-          <el-input-number v-model="countForm.actualReceivedAmount" style="width: 100%;" :min="0" :max="1111111111111111" :precision="2"
-            controls-position="right" @change="handleChange" />
+          <el-input-number v-model="countForm.actualReceivedAmount" style="width: 100%;" :min="0"
+            :max="1111111111111111" :precision="2" controls-position="right" @change="handleChange" />
         </el-form-item>
         <el-form-item prop="overinflatedAmount" label="虚增金额">
           <el-input v-model="countForm.overinflatedAmount" disabled></el-input>
@@ -346,6 +348,12 @@ const addTicket = () => {
 }
 const handleSearch = () => {
   console.log(searchList.value)
+  if (!route.query.id && !searchList.value.find(v => v.name === 'companyId')?.search) {
+    return ElMessage({
+      message: '请先选择公司',
+      type: 'warning'
+    })
+  }
   // router
   api.financeApi.getSelectedReceivableList({
     companyId: route.query.id,
@@ -491,7 +499,7 @@ const uploadJYFile = async (file) => {
   const { code, data, msg } = await api.financeApi.importAccountsReceivableInvoice(params)
   if (code == 200) {
     importModifyCallback.value = data
-    if(data.orderNos.length>0){
+    if (data.orderNos.length > 0) {
       api.financeApi.getSelectedReceivableList({ orderNos: data.orderNos }).then((res: any) => {
         if (res.code == 200) {
           tableData.value = res.data
@@ -545,6 +553,12 @@ const countRules = {
 }
 const isSettlement = ref(false)
 const handleTicket = (bool) => {
+  if(!tableData.value.length){
+    return ElMessage({
+      message: '应收明细为空',
+      type: 'warning'
+    })
+  }
   isSettlement.value = bool
   const params = {
     incomeIds: tableData.value.map(v => v.id),
@@ -731,7 +745,8 @@ onMounted(() => {
     .search-right {
       display: grid;
       grid-template-columns: repeat(2, 1fr);
-      gap:0  12px;
+      gap: 0 12px;
+
       .search-type {
         display: flex;
         align-items: center;
@@ -769,6 +784,7 @@ onMounted(() => {
   align-items: center;
   justify-content: center;
 }
+
 .imageDiv {
   position: relative;
   width: 80px;