Browse Source

feat:true

snow 5 months ago
parent
commit
71adbc23f0

+ 3 - 0
src/components/ZeroRelation/index.ts

@@ -0,0 +1,3 @@
+import ZeroRelation from "./src/index.vue"
+
+export default ZeroRelation

+ 90 - 0
src/components/ZeroRelation/src/index.vue

@@ -0,0 +1,90 @@
+<script setup lang="ts">
+import { watch, ref } from "vue"
+import { httpInvoiceDetail } from "/@/api/invoice"
+import { useTask } from "/@/hooks/core"
+
+const props = defineProps<{ code: string }>()
+
+
+
+const state = ref({
+  positive: [], // 正数-明细
+  negative: [], // 负数-明细
+})
+
+const invoiceDetailTask  = useTask<any>({ initialData: [], success(data = []) {
+  const positive = []
+  const negative = []
+  console.log(data)
+}})
+
+const refreshInvoiceDetail = () => invoiceDetailTask.run(httpInvoiceDetail({ code: props.code  }))
+
+
+watch(() => props.code, () => {
+  if(!props.code){ return }
+  refreshInvoiceDetail()
+},{
+  immediate: true
+})
+</script>
+
+
+<template>
+  <div class="flex flex-col border border-[#ebeef5]" v-loading="invoiceDetailTask.loading">
+    <div class="flex border-b-1 border-[#ebeef5]">
+      <div class="flex-1 border-r-1 border-[#ebeef5] p-[5px]">
+        <h3 class="font-bold">无需关联</h3>
+        <ElTable size="small" border>
+
+        </ElTable>
+        <h3 class="font-bold">关联结果</h3>
+
+        <ElTable size="small" border>
+        </ElTable>
+      </div>
+      
+      <div class="flex-1 p-[5px]">
+        <h3 class="font-[700]">待关联明细</h3>
+        <ElTable border size="small"></ElTable>
+      </div>
+    </div>
+
+
+    <div class="flex">
+      <div class="flex-1 border-r-1 border-[#ebeef5] p-[5px]">
+        <h3 class="font-bold">正数</h3>
+        
+        <h3>已关联</h3>
+        <ElTable border size="small"></ElTable>
+
+
+        <h3>未关联</h3>
+        <ElTable class="mb-[5px]" border size="small"></ElTable>
+      </div>
+      
+      
+      <div class="flex-1 py-[5px]">
+        <div class="px-[5px]">
+          <h3 class="font-bold">负数</h3>
+          <h3>已关联</h3>
+          <ElTable border size="small"></ElTable>
+          <h3>未关联</h3>
+          <ElTable class="mb-[5px]" border size="small"></ElTable>
+        </div>
+
+
+        <div class="border-t-1 border-[#ebeef5] p-[5px]">
+          <h3 class="font-bold">正在关联</h3>
+
+          <ElTable size="small" border></ElTable>
+
+
+          <div class="flex justify-end mt-[5px]">
+            <ElButton type="primary" size="small">确认关联</ElButton>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>

+ 7 - 0
src/views/purchaseNew/invoiceRelation/detail.vue

@@ -14,6 +14,8 @@ import { createTicketReturnColumns } from "/@/utils/details/_purchase";
 import OrderRelation from "/@/components/OrderRelation/src/index.vue";
 import InvoiceModal from "./components/invoice-modal.vue";
 
+import ZeroRelation from "/@/components/ZeroRelation"
+
 
 const pageName = "invoiceRelationDetail";
 
@@ -84,6 +86,11 @@ if (isDetail.value) requestDetail();
             <InvoiceModal ref="invoiceModalRef" />
             <!-- 审批节点 -->
             <template v-if="!isSuperUser">
+
+              <ElCollapseItem title="正负数发票关联" name="10">
+                <ZeroRelation :code="data.hpNo" />
+              </ElCollapseItem>
+
               <ElCollapseItem title="待发票与订单关联" name="8" v-if="data && data.status == '11'  && hasPermissionWithCode('063')">
                 <OrderRelation 
                   :code="data.hpNo"