Browse Source

合同开票记录修改

duy 2 years ago
parent
commit
df96191e90

+ 8 - 0
src/api/modules/project/project-contract.js

@@ -91,4 +91,12 @@ export default {
             data: form
         }, msg);
     },
+    //获取合同开票记录
+    async getContractInvoiceList(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-control/contractInfo/getContractInvoiceList',
+            method: 'get',
+            params: form
+        }, msg);
+    },
 }

+ 14 - 12
src/views/project/contract/components/record.vue

@@ -14,7 +14,7 @@
 
         <!--查看发票-->
         <HcDialog bgColor="#ffffff" isToBody isTable :footer="false" :show="recordModal" title="发票信息" widths="66rem" @close="closeRecordClick">
-            <HcPdf src="http://bladex-chongqing-info.oss-cn-hangzhou.aliyuncs.com//upload/20230504/911982ba85e66cfa58fb02d5a738bb2b.pdf"/>
+            <HcPdf :src="pdfUrl"/>
         </HcDialog>
     </HcCard>
 </template>
@@ -28,35 +28,37 @@ const router = useRouter()
 //参数
 const props = defineProps({
     datas: {
-        type: Object,
-        default: () => ({})
-    }
+        type: Array,
+        default: () => ([])
+    },
 })
 
-const infoData = ref(props.datas)
+const tableData = ref(props.datas)
 
 //深度监听
 watch(() => [
     props.datas,
 ], ([datas]) => {
-    infoData.value = datas
+    tableData.value = datas
 }, {deep: true})
 
 //成本测算表格
 const tableColumn = [
-    {key: 'key1', name: '开票日期',  align: 'center'},
-    {key: 'key2', name: '对方名称',  align: 'center'},
-    {key: 'key3', name: '开票金额', align: 'center'},
+    {key: 'invoiceDate', name: '开票日期',  align: 'center'},
+    {key: 'invoiceHead', name: '对方名称',  align: 'center'},
+    {key: 'invoiceMoney', name: '开票金额', align: 'center'},
     {key: 'action', name: '发票附件',  align: 'center'},
 ]
-const tableData = ref([
-    {id: 1}, {id: 2}, {id: 3}, {id: 4},
-])
+// const tableData = ref([
+//     {id: 1}, {id: 2}, {id: 3}, {id: 4},
+// ])
 
 //查看发票
 const recordModal = ref(false)
+const pdfUrl=ref('')
 const rowNameTap = (row) => {
     recordModal.value = true
+    pdfUrl.value=row?.invoicePdfUrl
 }
 
 const closeRecordClick = () => {

+ 11 - 0
src/views/project/contract/form.vue

@@ -56,6 +56,7 @@ onActivated(() => {
     if(dataType.value!=='add'){
         getContractInfoById()
         getListByContractId()
+        getRecordData()
         getProjectList(2)
     }else if(dataType.value=='add'){
         infoData.value={}
@@ -129,6 +130,16 @@ const getListByContractId=async()=>{
 }
 //合同开票记录
 const recordData=ref([])
+const getRecordData=async()=>{
+    const {error, code, data} = await contractApi.getContractInvoiceList({contractId: dataId.value})
+    if (!error && code === 200) {
+        recordData.value=getArrValue(data)
+       
+
+    } else {
+        recordData.value=[]
+    }
+}
 const saveLoaing=ref(false)
 const isEmptyObj=(obj)=> {
     let arr = Object.keys(obj);