@dongkboy 3 месяцев назад
Родитель
Сommit
7efe468376

+ 43 - 14
src/views/receivable/documentary/documentaryRecord.vue

@@ -73,11 +73,23 @@
       <el-table-column prop="settlementAmount" label="已结算金额" width="120"></el-table-column>
       <el-table-column prop="createBy" label="开票人" width="120"></el-table-column>
       <el-table-column prop="createTime" label="开票时间" width="150"></el-table-column>
-      <el-table-column label="操作" width="150" fixed="right">
+      <el-table-column label="操作" width="200" fixed="right">
         <template #default="scope">
-          <el-button link type="primary" v-if="scope.row.settlementStatus == '未结算'"  @click="handleCount(scope.row)">结算</el-button>
-          <el-button link type="primary" v-if="scope.row.settlementStatus == '已结算'" @click="handleView(scope.row)">明细查询</el-button>
-          <el-button link type="primary" v-if="scope.row.settlementStatus == '未结算'" @click="handleDelete(scope.row)">删除</el-button>
+          <div class="flex a-c ">
+            <el-button link type="primary" :disabled="scope.row.settlementStatus == '已结算'" @click="handleCount(scope.row)">结算</el-button>
+          <el-button link type="primary" :disabled="scope.row.settlementStatus == '已结算'" @click="handleDelete(scope.row)">删除</el-button>
+          <el-dropdown placement="bottom-start" trigger="click" >
+            <span class="el-dropdown-link">
+              明细查询
+            </span>
+            <template #dropdown>
+              <el-dropdown-menu>
+                <el-dropdown-item :disabled="scope.row.settlementStatus == '未结算'" @click="handleCountRecord(scope.row)">结算记录</el-dropdown-item>
+                <el-dropdown-item :disabled="scope.row.settlementStatus == '未结算'" @click="handleInvoiceDetail(scope.row)">开票明细</el-dropdown-item>
+              </el-dropdown-menu>
+            </template>
+          </el-dropdown>
+          </div>
 
 
         </template>
@@ -243,16 +255,6 @@ const calSub = async (minuend: number = 0, subtrahend: number) => {
   const res = await api.financeApi.calSub({ minuend, subtrahend })
   return res.data || 0
 }
-// 明细查询
-const handleView = (row) => {
-  router.push({
-    path: '/receivable/documentary/documentaryReport',
-    query: {
-      activeName: '2',
-      id: row.id
-    }
-  })
-}
 // 删除
 const handleDelete = (row) => {
   ElMessageBox.confirm(
@@ -281,6 +283,26 @@ const handleDelete = (row) => {
     .catch(() => {
     })
 }
+// 结算记录查询
+const handleCountRecord = (row) => {
+  router.push({
+    path: '/receivable/documentary/documentaryReport',
+    query: {
+      activeName: '2',
+      id: row.id
+    }
+  })
+}
+// 开票明细查询
+const handleInvoiceDetail = (row) => {
+  router.push({
+    path: '/receivable/documentary/documentaryReport',
+    query: {
+      activeName: '3',
+      id: row.id
+    }
+  })
+}
 // 列表
 const initList = () => {
   api.invoiceRecordApi.invoiceRecord({
@@ -440,4 +462,11 @@ onMounted(() => {
     color: #ccc;
   }
 }
+:deep(.el-dropdown-link) {
+  display: flex;
+  align-items: center;
+  margin-left: 15px;
+  color: var(--el-color-primary);
+  cursor: pointer;
+}
 </style>

+ 6 - 5
src/views/receivable/documentary/documentaryReport.vue

@@ -452,7 +452,7 @@ const initData1 = () => {
   })
 }
 const initData2 = () => {
-  api.settlementApi.superviseSettlementExcel({
+  api.settlementApi.followSettlementExcel({
     agreementType: '2',
     settlementId: recordForm1.value.settlementId,
     companyId: recordForm1.value.companyId,
@@ -689,12 +689,13 @@ const initOption = () => {
 }
 
 onMounted(() => {
-  if (route.query.activeName === '2') {
+  activeName.value = route.query.activeName;
+  if (route.query.activeName == "2") {
     recordForm1.value.invoiceId = route.query.id
-    activeName.value = '2'
     initData2();
-  } else {
-    initData1();
+  } else if (route.query.activeName == "3") {
+    recordForm2.value.invoiceId = route.query.id
+    initData3(['1']);
   }
   initData1();
   initCompany();