lxf 3 сар өмнө
parent
commit
23666677ef

+ 6 - 1
jy-ui/src/api/business/contract/info.ts

@@ -24,4 +24,9 @@ export function editApi(data: StrAnyObj): Promise<void> {
 // 合同删除
 export function deleteApi(data: StrAnyObj): Promise<void> {
   return request.post('/contractInfo/delete', data)
-}
+}
+
+// 统计数据
+export function getStatistics(params: StrAnyObj): Promise<void> {
+  return request.get('/contractInfo/statistics', params)
+}

+ 64 - 2
jy-ui/src/views/business/contract/info/index.vue

@@ -5,7 +5,14 @@ import { ToolbarConfigType } from '@/components/AToolbar/type'
 import { ColumnConfigType } from '@/components/ATable/type'
 import { StrAnyObj, StrAnyObjArr } from '@/typings'
 import { useHandleData } from '@/utils/useHandleData'
-import { getPageApi, getDetailApi, addApi, editApi, deleteApi } from '@/api/business/contract/info'
+import {
+  getPageApi,
+  getDetailApi,
+  addApi,
+  editApi,
+  deleteApi,
+  getStatistics
+} from '@/api/business/contract/info'
 import Detail from './detail.vue'
 
 const queryRef = ref<InstanceType<typeof AForm>>()
@@ -17,6 +24,7 @@ const pageTotal = ref<number>(0)
 
 const queryData = ref<StrAnyObj>({ pageNum: 1, pageSize: 10 })
 const tableData = ref<StrAnyObjArr>([])
+const statisticsData = ref<StrAnyObjArr>([])
 const formData = ref<StrAnyObj>({})
 
 const dialogTitle = ref<string>('')
@@ -81,6 +89,10 @@ const columnConfig: ColumnConfigType[] = [
     label: '保险费'
   },
   {
+    slot: 'receivedAmount',
+    label: '到账金额'
+  },
+  {
     prop: 'amount',
     label: '金额'
   },
@@ -391,10 +403,13 @@ onMounted(() => {
 })
 
 function getPage() {
-  getPageApi(queryData.value).then((resp) => {
+  getPageApi(queryData.value).then((resp: StrAnyObjArr) => {
     tableData.value = resp.records
     pageTotal.value = resp.total
   })
+  getStatistics(queryData.value).then((res: StrAnyObjArr) => {
+    statisticsData.value = res
+  })
 }
 
 function tableSelectionChange(item: StrAnyObjArr) {
@@ -438,6 +453,35 @@ function handleRemove(idList: string[]) {
     <el-card v-if="showQuery">
       <a-form ref="queryRef" v-model="queryData" :config="queryConfig" :span="6"> </a-form>
     </el-card>
+    <el-card style="margin-top: 10px">
+      <div style="display: flex; flex-wrap: wrap">
+        <div
+          v-for="(item, index) in statisticsData"
+          :key="index"
+          style="
+            width: calc(25% - 10px);
+            padding: 20px;
+            background-color: #b0e2ffa8;
+            margin-right: 10px;
+            border-radius: 10px;
+          "
+        >
+          <div style="font-size: 18px; font-weight: bold; color: black">
+            {{ item.sellerCompany }}
+          </div>
+          <div style="display: flex; color: #ce00ff; font-weight: bold; padding-top: 6px">
+            <div style="width: 33%">{{ item.contractQuantity }}</div>
+            <div style="width: 33%">{{ item.contractAmount }}</div>
+            <div style="width: 34%">{{ item.fundReceivedAmount }}</div>
+          </div>
+          <div style="display: flex; padding-top: 6px">
+            <div style="width: 33%">合同数量</div>
+            <div style="width: 33%">合同金额</div>
+            <div style="width: 34%">到账金额</div>
+          </div>
+        </div>
+      </div>
+    </el-card>
 
     <a-table
       :data="tableData"
@@ -451,6 +495,24 @@ function handleRemove(idList: string[]) {
       @page-size-change="getPage"
       @selection-change="tableSelectionChange"
     >
+      <template #receivedAmount="{ row }">
+        <div>
+          <el-popover placement="bottom" :width="400">
+            <template #reference>
+              <a style="color: #409eff; cursor: pointer; word-break: break-all">
+                {{ row.receivedAmount }}
+              </a>
+            </template>
+            <div v-if="row.capitalTransactionsList && row.capitalTransactionsList.length > 0">
+              <el-table :data="row.capitalTransactionsList" :border="false" style="width: 100%">
+                <el-table-column label="到账金额" prop="amount" width="100" />
+                <el-table-column label="用户" prop="nickname" width="100" />
+                <el-table-column label="到账时间" prop="tradingTime" min-width="100" />
+              </el-table>
+            </div>
+          </el-popover>
+        </div>
+      </template>
     </a-table>
 
     <a-dialog

+ 45 - 2
jy-ui/src/views/business/payment/requests/index.vue

@@ -21,6 +21,7 @@ import { getPageApi as getCapitalAccountPageApi } from '@/api/business/capital/a
 import { getDictByCode } from '@/utils/dict'
 import MoneyPDF from '@/components/PDF/moneyPDF.vue'
 import { getPdf } from '@/utils/getPdf.js'
+import { getPageApi as getContractPageApi } from '@/api/business/contract/info'
 
 const queryRef = ref<InstanceType<typeof AForm>>()
 const formRef = ref<InstanceType<typeof AForm>>()
@@ -30,6 +31,7 @@ const selectKeys = ref<string[]>([])
 const pageTotal = ref<number>(0)
 
 const queryData = ref<StrAnyObj>({ pageNum: 1, pageSize: 10 })
+const contractList = ref<StrAnyObjArr>([])
 const tableData = ref<StrAnyObjArr>([])
 const formData = ref<StrAnyObj>({ paymentRequestsDetailList: [{}] })
 
@@ -415,7 +417,12 @@ const detailTableColumnConfig: ColumnConfigType[] = [
   {
     slot: 'expenseType',
     label: '费用类型',
-    width: 250
+    width: 200
+  },
+  {
+    slot: 'contractId',
+    label: '关联合同',
+    width: 200
   },
   {
     slot: 'remark',
@@ -442,10 +449,23 @@ const detailTableColumnConfig: ColumnConfigType[] = [
 ]
 
 onMounted(() => {
+  getContract()
   getPage()
   selectDeptIdRef.value?.load()
 })
 
+function getContract() {
+  getContractPageApi({ pageNum: 1, pageSize: 999 }).then((res: StrAnyObjArr) => {
+    if (res.records && res.records.length > 0) {
+      contractList.value = res.records.map((item) => {
+        return {
+          label: item.contractNo,
+          value: item.id
+        }
+      })
+    }
+  })
+}
 function getPage() {
   getPageApi(queryData.value).then((resp) => {
     tableData.value = resp.records
@@ -475,6 +495,10 @@ function formSubmit() {
         ElMessage.error('请款明细存在费用类型为空,无法提交')
         return
       }
+      if (!item.contractId) {
+        ElMessage.error('请款明细存在关联合同为空,无法提交')
+        return
+      }
       if (!item.remark) {
         ElMessage.error('请款明细存在款项说明为空,无法提交')
         return
@@ -515,10 +539,14 @@ async function updateDetailRemark() {
   for (const item of expenseTypes) {
     expenseMap.set(item.value, item.label)
   }
+  const contract = new Map<number, string>()
+  for (const item of contractList.value) {
+    contract.set(item.value, item.label)
+  }
   formData.value.useRemark = formData.value.paymentRequestsDetailList
     .map(
       (item) =>
-        `【${expenseMap.get(item.expenseType) ?? ''}】 - ${item.remark ?? ''} - ${item.amount ?? ''}`
+        `【${expenseMap.get(item.expenseType) ?? ''}】 - 【${contract.get(item.contractId) ?? ''}】 - ${item.remark ?? ''} - ${item.amount ?? ''}`
     )
     .join('\n')
 }
@@ -611,6 +639,21 @@ const clickDownload = () => {
                 @change="updateDetailRemark"
               />
             </template>
+            <template #contractId="scope">
+              <el-select
+                v-model="scope.row.contractId"
+                :disabled="disabled"
+                @change="updateDetailRemark"
+              >
+                <el-option
+                  v-for="item in contractList"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </template>
             <template #remark="scope">
               <a-input
                 v-model="scope.row.remark"