sen
2026-02-02 311c2f13742aa71e7b16b76cd6f68175ee8a21a2
ui/admin-ui3/src/views/cwgl/receivableBillManagement/index.vue
@@ -18,10 +18,16 @@
      </template>
      <template #menu="{ size, row, index }">
        <el-link class="link-btn" type="primary" v-if="row.status == 0 || row.status == 1" :underline="false" plain :size="size" @click="handleSettle(row)"
          v-hasPermi="['cwgl:receivableBillManagement:view']"> 结算
          v-hasPermi="['cwgl:receivableBillManagement:receivableBillSettlementDetail']"> 结算
        </el-link>
        <el-link class="link-btn" type="primary" v-if="row.status == 0 || row.status == 1" :underline="false" plain :size="size" @click="makeInvoice(row)"
          v-hasPermi="['cwgl:receivableBillManagement:invoice']"> 开票
        </el-link>
           <el-link class="link-btn" type="primary" v-if="row.status == 0 || row.status == 1" :underline="false" plain :size="size" @click="makeParticulars(row)"
          v-hasPermi="['cwgl:receivableBillManagement:amount']"> 开票明细
        </el-link>
        <el-link class="link-btn" type="primary" v-if="row.status == 0 || row.status == 1|| row.status == 3" :underline="false" plain :size="size" @click="handleViewHistory(row)"
          v-hasPermi="['cwgl:receivableBillManagement:view']"> 结算明细
          v-hasPermi="['cwgl:receivableBillManagement:list']"> 结算明细
        </el-link>
        <el-link class="link-btn" type="primary" :underline="false" plain :size="size" @click="handleViewFeeDetail(row)"
          v-hasPermi="['cwgl:receivableBillManagement:view']"> 详情
@@ -40,6 +46,9 @@
  </basicContainer>
  <SettlementDialog ref="settleDialogRef" :type="currentType" @success="handleRefresh" />
  <makeOutInvoice ref="makeOutInvoiceRef" :type="makeType"  :InvoiceDetails="InvoiceDetails" @success="makeOutInvoiceFresh" />
  <BillSettlementHistory ref="historyRef" :type="activeType" />
  <NestedDetailDialog ref="feeDetailRef" :type="activeType" />
  <OperationLogModal ref="logModalRef" />
@@ -47,13 +56,17 @@
</template>
<script setup name="receivableBillManagement" lang="ts">
import { ReceivableBillManagementI, addReceivableBillManagement, delReceivableBillManagement, exportReceivableBillManagement, getReceivableBillManagement, listReceivableBillManagement, updateReceivableBillManagement,receivableBillManagementVoid } from "@/api/cwgl/receivableBillManagement";
  import { listReceivableInvoiceBusiness} from "@/api/cwgl/receivableInvoiceBusiness";
import { receivableBillManagementInvoice,invoiceAmount,ReceivableBillManagementI, addReceivableBillManagement, delReceivableBillManagement, exportReceivableBillManagement, getReceivableBillManagement, listReceivableBillManagement, updateReceivableBillManagement,receivableBillManagementVoid } from "@/api/cwgl/receivableBillManagement";
import useCurrentInstance from "@/utils/useCurrentInstance";
import { computed, reactive, ref, toRefs } from "vue";
import { PagesInterface, PageQueryInterface } from "@/utils/globalInterface";
import { usePagePlus } from "@/hooks/usePagePlus";
import { hasPermission } from "@/utils/permissionUtils";
import SettlementDialog from '@/components/SettlementDialog/index.vue';
import makeOutInvoice from '@/components/makeOutInvoice/index.vue';
import BillSettlementHistory from '../../../components/BillSettlementHistory/index.vue';
import NestedDetailDialog from '../../../components/NestedDetailDialog/index.vue';
import OperationLogModal from '@/components/OperationLogModal/index.vue';
@@ -339,10 +352,36 @@
  })
}
/* 开票 */
const makeOutInvoiceRef = ref()
const makeType = ref<'应付账单开票' | '应收账单开票'>('应收账单开票')
const InvoiceDetails = ref('')
const makeInvoice =(row) =>{
  currentType.value = '应收账单开票'
  InvoiceDetails.value = '本次开票信息'
  ids.value = row.id
  invoiceAmount(row.id).then((res)=>{
    if(res.code==200){
      row.invoicedAmount=res.data
      makeOutInvoiceRef.value.open(row)
    }
  })
  // headId
}
const makeParticulars =(row) =>{
  currentType.value = '应收账单开票记录'
  InvoiceDetails.value = '开票明细'
  ids.value = row.id
  listReceivableInvoiceBusiness({headId: row.id}).then((res) => {
    if (res.code === 200) {
      row.recordList=res.rows
      makeOutInvoiceRef.value.open(row)
    }
  })
}
const handleRefresh = (data) => {
  console.log(data);
  // ids.value 
  data.billId = ids.value
  addReceivableBillSettlementDetail(data).then((res) => {
@@ -394,5 +433,17 @@
    }
  });
}
const makeOutInvoiceFresh = (submitData: any) => {
  // 这里调用后端的保存接口
  receivableBillManagementInvoice(submitData,submitData.id).then(res => {
    if (res.code == 200) {
      proxy.$modal.msgSuccess(res.msg);
      makeOutInvoiceRef.value.openIshpw()
      onLoad(page.value); // 刷新列表
    }
  })
}
</script>