Browse Source

Merge remote-tracking branch 'origin/master'

24282 2 months ago
parent
commit
b2bad45456

+ 1 - 1
jy-ui/.prettierrc.json

@@ -3,6 +3,6 @@
   "semi": false,
   "tabWidth": 2,
   "singleQuote": true,
-  "printWidth": 100,
+  "printWidth": 180,
   "trailingComma": "none"
 }

+ 20 - 0
jy-ui/src/api/business/contract/info.ts

@@ -35,3 +35,23 @@ export function getStatistics(params: StrAnyObj): Promise<void> {
 export function getTransactionList(params: StrAnyObj): Promise<void> {
   return request.get('/contractInfo/getTransactionList', params)
 }
+
+// 客户付款数据
+export function getFundReceived(params: StrAnyObj): Promise<void> {
+  return request.get('/contractFundReceived/getList', params)
+}
+
+// 请款数据
+export function getPayment(params: StrAnyObj): Promise<void> {
+  return request.get('/paymentRequests/getDetailList', params)
+}
+
+// 订单
+export function getOrderList(params: StrAnyObj): Promise<void> {
+  return request.get('/contractInfo/getOrderList', params)
+}
+
+// 结算利润
+export function settlementProfit(data: StrAnyObj): Promise<void> {
+  return request.post('/contractInfo/settlement', data)
+}

+ 48 - 385
jy-ui/src/components/PDF/moneyPDF.vue

@@ -11,134 +11,41 @@
         </div>
         <div style="border: 1px solid black">
           <div style="display: flex; border-bottom: 1px solid black">
-            <div
-              style="
-                max-width: 140px;
-                min-width: 140px;
-                border-right: 1px solid black;
-                padding: 8px;
-              "
-            >
-              创建人
-            </div>
+            <div style="max-width: 140px; min-width: 140px; border-right: 1px solid black; padding: 8px">创建人</div>
             <div style="width: calc(100% - 140px); padding: 8px">
               {{ printDetails.userName }}
             </div>
           </div>
           <div style="display: flex; border-bottom: 1px solid black">
-            <div
-              style="
-                max-width: 140px;
-                min-width: 140px;
-                border-right: 1px solid black;
-                padding: 8px;
-              "
-            >
-              创建人部门
-            </div>
+            <div style="max-width: 140px; min-width: 140px; border-right: 1px solid black; padding: 8px">创建人部门</div>
             <div style="width: calc(100% - 140px); padding: 8px">
               {{ printDetails.deptName }}
             </div>
           </div>
-          <div
-            style="display: flex; border-bottom: 1px solid black"
-            v-if="printDetails.type != '3'"
-          >
-            <div
-              style="
-                max-width: 140px;
-                min-width: 140px;
-                border-right: 1px solid black;
-                padding: 4px 8px;
-                display: flex;
-                align-items: center;
-              "
-            >
-              费用明细
-            </div>
+          <div style="display: flex; border-bottom: 1px solid black" v-if="printDetails.type != '3'">
+            <div style="max-width: 140px; min-width: 140px; border-right: 1px solid black; padding: 4px 8px; display: flex; align-items: center">费用明细</div>
             <div style="width: calc(100% - 140px)">
               <div style="border-bottom: 1px solid black; display: flex">
-                <div
-                  style="
-                    max-width: 140px;
-                    min-width: 140px;
-                    padding: 4px 8px;
-                    border-right: 1px solid black;
-                    text-align: center;
-                  "
-                >
-                  费用类型
-                </div>
-                <div
-                  style="
-                    width: calc(100% - 300px);
-                    padding: 4px 8px;
-                    border-right: 1px solid black;
-                    text-align: center;
-                  "
-                >
-                  款项说明
-                </div>
-                <div
-                  style="
-                    width: 60px;
-                    padding: 4px 8px;
-                    border-right: 1px solid black;
-                    text-align: center;
-                  "
-                >
-                  货币
-                </div>
-                <div style="width: 100px; padding: 4px 8px; text-align: center">付款金额</div>
+                <div style="max-width: 100px; min-width: 100px; padding: 4px 8px; border-right: 1px solid black; text-align: center">费用类型</div>
+                <div style="width: 120px; padding: 4px 8px; border-right: 1px solid black; text-align: center">关联合同</div>
+                <div style="width: calc(100% - 360px); padding: 4px 8px; border-right: 1px solid black; text-align: center">款项说明</div>
+                <div style="width: 60px; padding: 4px 8px; border-right: 1px solid black; text-align: center">货币</div>
+                <div style="width: 80px; padding: 4px 8px; text-align: center">付款金额</div>
               </div>
-              <template
-                v-if="
-                  printDetails.paymentRequestsDetailList &&
-                  printDetails.paymentRequestsDetailList.length > 0
-                "
-              >
+              <template v-if="printDetails.paymentRequestsDetailList && printDetails.paymentRequestsDetailList.length > 0">
                 <div v-for="(item, index) in printDetails.paymentRequestsDetailList" :key="index">
-                  <div
-                    :style="
-                      index + 1 !== printDetails.paymentRequestsDetailList.length
-                        ? 'border-bottom: 1px solid black;  display: flex'
-                        : ' display: flex'
-                    "
-                  >
-                    <div
-                      style="
-                        max-width: 140px;
-                        min-width: 140px;
-                        padding: 4px 8px;
-                        border-right: 1px solid black;
-                        text-align: center;
-                      "
-                    >
+                  <div :style="index + 1 !== printDetails.paymentRequestsDetailList.length ? 'border-bottom: 1px solid black;  display: flex' : ' display: flex'">
+                    <div style="max-width: 100px; min-width: 100px; padding: 4px 8px; border-right: 1px solid black; text-align: center">
                       {{ dictValueLabel(item.expenseType, expenseType) }}
                     </div>
-                    <div
-                      style="
-                        width: calc(100% - 300px);
-                        padding: 4px 8px;
-                        border-right: 1px solid black;
-                        display: flex;
-                        align-items: center;
-                      "
-                    >
-                      {{ item.remark }}
+                    <div style="width: 120px; padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">
+                      {{ item.contractNo }}
                     </div>
-                    <div
-                      style="
-                        width: 60px;
-                        padding: 4px 8px;
-                        border-right: 1px solid black;
-                        display: flex;
-                        align-items: center;
-                      "
-                    >
-                      人民币
+                    <div style="width: calc(100% - 360px); padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">
+                      {{ item.remark }}
                     </div>
-                    <div style="width: 100px; padding: 4px 8px; display: flex; align-items: center">
+                    <div style="width: 60px; padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">人民币</div>
+                    <div style="width: 80px; padding: 4px 8px; display: flex; align-items: center">
                       {{ item.amount }}
                     </div>
                   </div>
@@ -147,119 +54,26 @@
             </div>
           </div>
           <div style="display: flex; border-bottom: 1px solid black" v-else>
-            <div
-              style="
-                max-width: 140px;
-                min-width: 140px;
-                border-right: 1px solid black;
-                padding: 4px 8px;
-                display: flex;
-                align-items: center;
-              "
-            >
-              费用明细
-            </div>
+            <div style="max-width: 140px; min-width: 140px; border-right: 1px solid black; padding: 4px 8px; display: flex; align-items: center">费用明细</div>
             <div style="width: calc(100% - 140px)">
               <div style="border-bottom: 1px solid black; display: flex">
-                <div
-                  style="
-                    max-width: 140px;
-                    min-width: 140px;
-                    padding: 4px 8px;
-                    border-right: 1px solid black;
-                    text-align: center;
-                  "
-                >
-                  费用类型
-                </div>
-                <div
-                  style="
-                    width: calc(100% - 360px);
-                    padding: 4px 8px;
-                    border-right: 1px solid black;
-                    text-align: center;
-                  "
-                >
-                  款项说明
-                </div>
-                <div
-                  style="
-                    width: 60px;
-                    padding: 4px 8px;
-                    border-right: 1px solid black;
-                    text-align: center;
-                  "
-                >
-                  货币
-                </div>
-                <div
-                  style="
-                    width: 80px;
-                    padding: 4px 8px;
-                    border-right: 1px solid black;
-                    text-align: center;
-                  "
-                >
-                  预支金额
-                </div>
+                <div style="max-width: 140px; min-width: 140px; padding: 4px 8px; border-right: 1px solid black; text-align: center">费用类型</div>
+                <div style="width: calc(100% - 360px); padding: 4px 8px; border-right: 1px solid black; text-align: center">款项说明</div>
+                <div style="width: 60px; padding: 4px 8px; border-right: 1px solid black; text-align: center">货币</div>
+                <div style="width: 80px; padding: 4px 8px; border-right: 1px solid black; text-align: center">预支金额</div>
                 <div style="width: 80px; padding: 4px 8px; text-align: center">付款金额</div>
               </div>
-              <template
-                v-if="
-                  printDetails.paymentRequestsDetailList &&
-                  printDetails.paymentRequestsDetailList.length > 0
-                "
-              >
+              <template v-if="printDetails.paymentRequestsDetailList && printDetails.paymentRequestsDetailList.length > 0">
                 <div v-for="(item, index) in printDetails.paymentRequestsDetailList" :key="index">
-                  <div
-                    :style="
-                      index + 1 !== printDetails.paymentRequestsDetailList.length
-                        ? 'border-bottom: 1px solid black;  display: flex'
-                        : ' display: flex'
-                    "
-                  >
-                    <div
-                      style="
-                        max-width: 140px;
-                        min-width: 140px;
-                        padding: 4px 8px;
-                        border-right: 1px solid black;
-                        text-align: center;
-                      "
-                    >
+                  <div :style="index + 1 !== printDetails.paymentRequestsDetailList.length ? 'border-bottom: 1px solid black;  display: flex' : ' display: flex'">
+                    <div style="max-width: 140px; min-width: 140px; padding: 4px 8px; border-right: 1px solid black; text-align: center">
                       {{ dictValueLabel(item.expenseType, expenseType) }}
                     </div>
-                    <div
-                      style="
-                        width: calc(100% - 360px);
-                        padding: 4px 8px;
-                        border-right: 1px solid black;
-                        display: flex;
-                        align-items: center;
-                      "
-                    >
+                    <div style="width: calc(100% - 360px); padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">
                       {{ item.remark }}
                     </div>
-                    <div
-                      style="
-                        width: 60px;
-                        padding: 4px 8px;
-                        border-right: 1px solid black;
-                        display: flex;
-                        align-items: center;
-                      "
-                    >
-                      人民币
-                    </div>
-                    <div
-                      style="
-                        width: 80px;
-                        padding: 4px 8px;
-                        border-right: 1px solid black;
-                        display: flex;
-                        align-items: center;
-                      "
-                    >
+                    <div style="width: 60px; padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">人民币</div>
+                    <div style="width: 80px; padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">
                       {{ item.advanceAmount }}
                     </div>
                     <div style="width: 80px; padding: 4px 8px; display: flex; align-items: center">
@@ -270,20 +84,8 @@
               </template>
             </div>
           </div>
-          <div
-            style="display: flex; border-bottom: 1px solid black"
-            v-if="printDetails.type !== '3'"
-          >
-            <div
-              style="
-                max-width: 140px;
-                min-width: 140px;
-                border-right: 1px solid black;
-                padding: 8px;
-              "
-            >
-              总报销金额
-            </div>
+          <div style="display: flex; border-bottom: 1px solid black" v-if="printDetails.type !== '3'">
+            <div style="max-width: 140px; min-width: 140px; border-right: 1px solid black; padding: 8px">总报销金额</div>
             <div style="width: calc(100% - 140px); display: flex">
               <div style="width: calc(100% - 100px); padding: 8px; border-right: 1px solid black">
                 {{ NumberToChinese(computeMoney('amount')) }}
@@ -295,16 +97,7 @@
           </div>
           <div v-else>
             <div style="display: flex; border-bottom: 1px solid black">
-              <div
-                style="
-                  max-width: 140px;
-                  min-width: 140px;
-                  border-right: 1px solid black;
-                  padding: 8px;
-                "
-              >
-                核销总金额
-              </div>
+              <div style="max-width: 140px; min-width: 140px; border-right: 1px solid black; padding: 8px">核销总金额</div>
               <div style="width: calc(100% - 140px); display: flex">
                 <div style="width: calc(100% - 80px); padding: 8px; border-right: 1px solid black">
                   {{ NumberToChinese(computeMoney('amount')) }}
@@ -315,16 +108,7 @@
               </div>
             </div>
             <div style="display: flex; border-bottom: 1px solid black">
-              <div
-                style="
-                  max-width: 140px;
-                  min-width: 140px;
-                  border-right: 1px solid black;
-                  padding: 8px;
-                "
-              >
-                预支总金额
-              </div>
+              <div style="max-width: 140px; min-width: 140px; border-right: 1px solid black; padding: 8px">预支总金额</div>
               <div style="width: calc(100% - 140px); display: flex">
                 <div style="width: calc(100% - 80px); padding: 8px; border-right: 1px solid black">
                   {{ NumberToChinese(computeMoney('advanceAmount')) }}
@@ -335,16 +119,7 @@
               </div>
             </div>
             <div style="display: flex; border-bottom: 1px solid black">
-              <div
-                style="
-                  max-width: 140px;
-                  min-width: 140px;
-                  border-right: 1px solid black;
-                  padding: 8px;
-                "
-              >
-                差额 (核销 - 预支)
-              </div>
+              <div style="max-width: 140px; min-width: 140px; border-right: 1px solid black; padding: 8px">差额 (核销 - 预支)</div>
               <div style="width: calc(100% - 140px); display: flex">
                 <div style="width: calc(100% - 80px); padding: 8px; border-right: 1px solid black">
                   {{ NumberToChinese(computeBalance()) }}
@@ -356,153 +131,48 @@
             </div>
           </div>
           <div style="display: flex; border-bottom: 1px solid black">
-            <div
-              style="
-                max-width: 140px;
-                min-width: 140px;
-                border-right: 1px solid black;
-                padding: 8px;
-              "
-            >
-              单据数量
-            </div>
+            <div style="max-width: 140px; min-width: 140px; border-right: 1px solid black; padding: 8px">单据数量</div>
             <div style="width: calc(100% - 140px); padding: 8px">
               {{ printDetails.documentQuantity }}
             </div>
           </div>
           <div style="display: flex; border-bottom: 1px solid black">
-            <div
-              style="
-                max-width: 140px;
-                min-width: 140px;
-                border-right: 1px solid black;
-                padding: 0 8px;
-                display: flex;
-                align-items: center;
-              "
-            >
-              收款信息
-            </div>
+            <div style="max-width: 140px; min-width: 140px; border-right: 1px solid black; padding: 0 8px; display: flex; align-items: center">收款信息</div>
             <div style="width: calc(100% - 140px)">
               <div style="border-bottom: 1px solid black; display: flex">
-                <div
-                  style="
-                    width: 19%;
-                    padding: 0 8px;
-                    border-right: 1px solid black;
-                    text-align: center;
-                  "
-                >
-                  支付方式
-                </div>
-                <div
-                  style="
-                    width: 27%;
-                    padding: 0 8px;
-                    border-right: 1px solid black;
-                    text-align: center;
-                  "
-                >
-                  收款方户名
-                </div>
-                <div
-                  style="
-                    width: 27%;
-                    padding: 0 8px;
-                    border-right: 1px solid black;
-                    text-align: center;
-                  "
-                >
-                  开户行
-                </div>
+                <div style="width: 19%; padding: 0 8px; border-right: 1px solid black; text-align: center">支付方式</div>
+                <div style="width: 27%; padding: 0 8px; border-right: 1px solid black; text-align: center">收款方户名</div>
+                <div style="width: 27%; padding: 0 8px; border-right: 1px solid black; text-align: center">开户行</div>
                 <div style="width: 27%; padding: 0 8px; text-align: center">收款方账号</div>
               </div>
               <div style="display: flex">
-                <div
-                  style="
-                    width: 19%;
-                    padding: 0 8px;
-                    border-right: 1px solid black;
-                    display: flex;
-                    align-items: center;
-                  "
-                >
+                <div style="width: 19%; padding: 0 8px; border-right: 1px solid black; display: flex; align-items: center">
                   {{ dictValueLabel(printDetails.payType, payType) }}
                 </div>
-                <div
-                  style="
-                    width: 27%;
-                    padding: 0 8px;
-                    border-right: 1px solid black;
-                    display: flex;
-                    align-items: center;
-                  "
-                >
+                <div style="width: 27%; padding: 0 8px; border-right: 1px solid black; display: flex; align-items: center">
                   {{ printDetails.accountName }}
                 </div>
-                <div
-                  style="
-                    width: 27%;
-                    padding: 0 8px;
-                    border-right: 1px solid black;
-                    display: flex;
-                    align-items: center;
-                  "
-                >
+                <div style="width: 27%; padding: 0 8px; border-right: 1px solid black; display: flex; align-items: center">
                   {{ printDetails.depositBank }}
                 </div>
-                <div
-                  style="
-                    width: 27%;
-                    padding: 0 8px;
-                    display: flex;
-                    align-items: center;
-                    word-break: break-all;
-                  "
-                >
+                <div style="width: 27%; padding: 0 8px; display: flex; align-items: center; word-break: break-all">
                   {{ printDetails.account }}
                 </div>
               </div>
             </div>
           </div>
           <div style="display: flex; border-bottom: 1px solid black">
-            <div
-              style="
-                max-width: 140px;
-                min-width: 140px;
-                border-right: 1px solid black;
-                padding: 8px;
-              "
-            >
-              电子发票(PDF/JPG)
-            </div>
+            <div style="max-width: 140px; min-width: 140px; border-right: 1px solid black; padding: 8px">电子发票(PDF/JPG)</div>
             <div style="width: calc(100% - 140px); padding: 8px">
               {{ getAtts(printDetails.atts) }}
             </div>
           </div>
           <div style="display: flex">
-            <div
-              style="
-                max-width: 140px;
-                min-width: 140px;
-                border-right: 1px solid black;
-                padding: 4px 8px;
-                display: flex;
-                align-items: center;
-              "
-            >
-              审批流程
-            </div>
+            <div style="max-width: 140px; min-width: 140px; border-right: 1px solid black; padding: 4px 8px; display: flex; align-items: center">审批流程</div>
             <div style="width: calc(100% - 140px)">
               <template v-if="recordList && recordList.length > 0">
                 <div v-for="(item, index) in recordList" :key="index">
-                  <div
-                    :style="
-                      index + 1 !== recordList.length
-                        ? 'border-bottom: 1px solid black; padding: 4px 8px; display: flex'
-                        : 'padding: 4px 8px; display: flex'
-                    "
-                  >
+                  <div :style="index + 1 !== recordList.length ? 'border-bottom: 1px solid black; padding: 4px 8px; display: flex' : 'padding: 4px 8px; display: flex'">
                     <div style="width: calc(100% - 120px); word-wrap: break-word">
                       <span>{{ item.nodeName }}: </span>
                       <span style="padding-left: 4px">{{ item.approver }}</span>
@@ -592,17 +262,10 @@ function getDictData() {
 getDictData()
 const computeMoney = (label) => {
   let amount = 0
-  if (
-    printDetails.value.paymentRequestsDetailList &&
-    printDetails.value.paymentRequestsDetailList.length > 0
-  ) {
+  if (printDetails.value.paymentRequestsDetailList && printDetails.value.paymentRequestsDetailList.length > 0) {
     for (let i = 0; i < printDetails.value.paymentRequestsDetailList.length; i++) {
       if (printDetails.value.paymentRequestsDetailList[i][label]) {
-        amount = Number(
-          parseFloat(
-            Number(amount) + Number(printDetails.value.paymentRequestsDetailList[i][label])
-          ).toFixed(2)
-        )
+        amount = Number(parseFloat(Number(amount) + Number(printDetails.value.paymentRequestsDetailList[i][label])).toFixed(2))
       }
     }
   }

+ 22 - 28
jy-ui/src/views/business/contract/info/index.vue

@@ -5,16 +5,10 @@ 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,
-  getStatistics
-} from '@/api/business/contract/info'
+import { getPageApi, getDetailApi, addApi, editApi, deleteApi, getStatistics } from '@/api/business/contract/info'
 import Detail from './detail.vue'
 import TransactionDetail from './transaction-detail.vue'
+import OrderDetail from './order-detail.vue'
 
 const queryRef = ref<InstanceType<typeof AForm>>()
 const formRef = ref<InstanceType<typeof AForm>>()
@@ -50,7 +44,7 @@ const queryConfig: FormConfigType[] = [
       {
         key: 20,
         label: '已完成'
-      },
+      }
     ]
   },
   {
@@ -159,6 +153,13 @@ const columnConfig: ColumnConfigType[] = [
     }
   },
   {
+    prop: 'hasSettlement',
+    label: '是否结算',
+    formatter: (row) => {
+      return row.hasSettlement == 1 ? '是' : '否'
+    }
+  },
+  {
     width: 120,
     handleConfig: [
       {
@@ -185,9 +186,7 @@ const formConfig: FormConfigType[] = [
     type: 'input',
     prop: 'type',
     label: '合同类型 1-三梵合同,2-佰易来合同',
-    rule: [
-      { required: true, message: '合同类型 1-三梵合同,2-佰易来合同不能为空', trigger: 'blur' }
-    ]
+    rule: [{ required: true, message: '合同类型 1-三梵合同,2-佰易来合同不能为空', trigger: 'blur' }]
   },
   {
     type: 'input',
@@ -514,6 +513,12 @@ function handleRemove(idList: string[]) {
     })
   })
 }
+function clickCancel(params: type) {
+  if (params) {
+    getPage()
+  }
+  dialogVisible.value = false
+}
 </script>
 
 <template>
@@ -526,13 +531,7 @@ function handleRemove(idList: string[]) {
         <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;
-          "
+          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 }}
@@ -585,15 +584,7 @@ function handleRemove(idList: string[]) {
       </template>
     </a-table>
 
-    <a-dialog
-      v-if="dialogVisible"
-      v-model="dialogVisible"
-      :title="dialogTitle"
-      @submit="formSubmit"
-      @closed="formClosed"
-      style="width: 1100px"
-      :footer="false"
-    >
+    <a-dialog v-if="dialogVisible" v-model="dialogVisible" :title="dialogTitle" @submit="formSubmit" @closed="formClosed" style="width: 1100px" :footer="false">
       <el-tabs v-model="activeName" type="card">
         <el-tab-pane label="合同详情" name="1">
           <Detail :rowData="formData"></Detail>
@@ -601,6 +592,9 @@ function handleRemove(idList: string[]) {
         <el-tab-pane label="交易明细" name="2">
           <TransactionDetail :rowData="formData"></TransactionDetail>
         </el-tab-pane>
+        <el-tab-pane label="结算账目" name="3">
+          <OrderDetail :rowData="formData" @clickCancel="clickCancel"></OrderDetail>
+        </el-tab-pane>
       </el-tabs>
     </a-dialog>
   </div>

+ 309 - 0
jy-ui/src/views/business/contract/info/order-detail.vue

@@ -0,0 +1,309 @@
+<template>
+  <div style="max-height: calc(100vh - 200px); overflow: hidden auto">
+    <el-form-item label="订单" :label-position="'top'">
+      <el-table :data="formData.data.order" style="width: 100%">
+        <el-table-column label="订单号">
+          <template v-slot="scope">
+            <div>
+              <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickDetail(scope.row)">
+                {{ scope.row.orderNo }}
+              </a>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="订单金额" prop="paymentPrice" />
+        <el-table-column label="三梵成本" prop="costAmount" />
+        <el-table-column label="预计总利润" prop="expectedProfit" />
+      </el-table>
+    </el-form-item>
+    <el-form-item label="请款" :label-position="'top'">
+      <el-table :data="formData.data.payment" style="width: 100%">
+        <el-table-column label="请款类型">
+          <template v-slot="scope">
+            <div>
+              {{ dictKeyValue(scope.row.type, expenseType) }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="请款金额" prop="amount" />
+        <el-table-column label="请款时间" prop="requestsTime" />
+        <el-table-column label="打款时间" prop="remitTime" />
+      </el-table>
+    </el-form-item>
+    <el-form-item label="客户付款" :label-position="'top'">
+      <el-table :data="formData.data.fundReceived" style="width: 100%">
+        <el-table-column label="客户付款金额" prop="receivedAmount" />
+        <el-table-column label="付款时间" prop="receivedTime" />
+        <el-table-column label="是否认领" prop="hasReceived">
+          <template v-slot="scope">
+            <div>
+              {{ scope.row.hasReceived ? '是' : '否' }}
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-form-item>
+    <el-form-item label="总利润" :label-position="'top'">
+      <div style="display: flex; justify-content: space-between; width: 100%">
+        <span>{{ calculateTotalProfit() }}</span>
+        <el-button type="primary" v-if="rowData.hasSettlement != 1" @click="clickSettlement()">利润结算</el-button>
+      </div>
+    </el-form-item>
+
+    <a-dialog v-if="dialogVisible" v-model="dialogVisible" title="订单详情" style="width: 90%" :footer="false">
+      <div style="max-height: calc(100vh - 160px); overflow: hidden auto">
+        <div style="width: 100%">
+          <el-table :data="orderDetail.orderItemList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
+            <el-table-column label="图片" width="130">
+              <template #default="props">
+                <el-image
+                  style="width: 100px; height: 100px; border: 1px solid #ccc"
+                  v-if="props.row.picUrls && props.row.picUrls.length > 0 && props.row.picUrls[0]"
+                  :src="props.row.picUrls[0]"
+                  fit="scale-down"
+                  :referrerpolicy="'no-referrer'"
+                  :zoom-rate="1.2"
+                  :preview-src-list="[props.row.picUrls[0]]"
+                  :initial-index="0"
+                  preview-teleported
+                >
+                </el-image>
+                <el-image
+                  style="width: 100px; height: 100px; border: 1px solid #ccc"
+                  v-else
+                  :src="props.row.picUrl"
+                  fit="scale-down"
+                  :referrerpolicy="'no-referrer'"
+                  :zoom-rate="1.2"
+                  :preview-src-list="[props.row.picUrl]"
+                  :initial-index="0"
+                  preview-teleported
+                >
+                </el-image>
+              </template>
+            </el-table-column>
+            <el-table-column label="设计图" width="130">
+              <template #default="props">
+                <el-image
+                  style="width: 100px; border: 1px solid #ccc"
+                  v-if="props.row.customizeVo && props.row.customizeVo.blueprintUrl"
+                  :src="props.row.customizeVo.blueprintUrl"
+                  fit="scale-down"
+                  :referrerpolicy="'no-referrer'"
+                  :zoom-rate="1.2"
+                  :preview-src-list="[props.row.customizeVo.blueprintUrl]"
+                  :initial-index="0"
+                  preview-teleported
+                >
+                </el-image>
+              </template>
+            </el-table-column>
+            <el-table-column label="商品信息" min-width="300">
+              <template #default="props">
+                <div>
+                  <div>SKU编码:{{ props.row.skuId }}</div>
+                  <div>商品名称:{{ props.row.spuName }}</div>
+                  <div>商品属性:{{ props.row.attrValue }}</div>
+                  <div v-if="orderDetail.type == 1">颜色:{{ props.row.colour || (props.row.customizeVo ? props.row.customizeVo.colour : '') }}</div>
+                  <div>规格:{{ props.row.length }} * {{ props.row.width }} * {{ props.row.height }}</div>
+                  <div>其他定制明细:{{ props.row.additionalCustomizeDetails }}</div>
+                  <div>其他定制总费用:{{ props.row.additionalCustomizePrice }}</div>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="单价" width="120">
+              <template #default="props">{{ orderDetail.settlementCurrency }} {{ props.row.salesPrice }}</template>
+            </el-table-column>
+            <el-table-column label="运费" width="120" v-if="orderDetail.deliveryWay == '1'">
+              <template #default="props"> {{ orderDetail.settlementCurrency }} {{ props.row.freightPrice }} </template>
+            </el-table-column>
+            <el-table-column label="数量" prop="quantity" width="120" v-if="orderDetail.type == 1" />
+            <el-table-column label="数量" min-width="300" v-if="orderDetail.type == 2">
+              <template #default="props">
+                <div v-if="props.row.customizeVo.colourList && props.row.customizeVo.colourList.length > 0">
+                  <el-table :data="props.row.customizeVo.colourList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
+                    <el-table-column label="颜色" prop="colour" />
+                    <el-table-column label="图片" width="100">
+                      <template #default="item">
+                        <div>
+                          <el-image
+                            v-if="item.row.picUrl"
+                            :src="item.row.picUrl"
+                            style="max-width: 80px"
+                            fit="scale-down"
+                            :referrerpolicy="'no-referrer'"
+                            :zoom-rate="1.2"
+                            :preview-src-list="[item.row.picUrl]"
+                            :initial-index="0"
+                            preview-teleported
+                          >
+                          </el-image>
+                        </div>
+                      </template>
+                    </el-table-column>
+                    <el-table-column label="SKU编码" prop="skuId" width="140" />
+                    <el-table-column label="数量" prop="quantity" />
+                  </el-table>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="定制金额" width="140">
+              <template #default="props">{{ orderDetail.settlementCurrency }} {{ computeMoney(props.row) }} </template>
+            </el-table-column>
+            <el-table-column label="商品总金额" width="160">
+              <template #default="props">{{ orderDetail.settlementCurrency }} {{ props.row.paymentPrice }} </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <div style="width: 100%; margin-top: 20px" v-if="orderDetail.packagingList && orderDetail.packagingList.length > 0">
+          <el-table :data="orderDetail.packagingList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
+            <el-table-column label="包材名称" prop="name" />
+            <el-table-column label="单价">
+              <template #default="props">
+                <div>{{ orderDetail.settlementCurrency }} {{ props.row.salesPrice }}</div>
+              </template>
+            </el-table-column>
+            <el-table-column label="数量" prop="quantity" />
+            <el-table-column label="包材费用小计" width="120">
+              <template #default="props">
+                <div>{{ orderDetail.settlementCurrency }} {{ packagingSubtotal(props.row) }}</div>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <div style="margin-top: 20px; font-size: 18px; font-weight: bold; color: black">
+          <span>订单总金额: {{ orderDetail.settlementCurrency }} {{ orderTotal() }}</span>
+          <span style="margin-left: 40px"> 商品总金额: {{ orderDetail.settlementCurrency }} {{ goodsTotal() }} </span>
+          <span style="margin-left: 40px"> 包材总金额: {{ orderDetail.settlementCurrency }} {{ packagingTotal() }} </span>
+        </div>
+      </div>
+    </a-dialog>
+  </div>
+</template>
+
+<script setup>
+import { getFundReceived, getPayment, getOrderList, settlementProfit } from '@/api/business/contract/info'
+import { getListByCodeApi } from '@/api/system/dictData'
+import { ElMessage, ElMessageBox } from 'element-plus'
+
+const props = defineProps({
+  rowData: Object
+})
+const formData = reactive({
+  data: {
+    order: [],
+    payment: [],
+    fundReceived: []
+  }
+})
+const dialogVisible = ref(false)
+const orderDetail = ref({
+  orderItemList: [],
+  packagingList: []
+})
+const expenseType = ref([])
+const calculateTotalProfit = () => {
+  let profit = 0
+  if (formData.data.fundReceived && formData.data.fundReceived.length > 0) {
+    for (let i = 0; i < formData.data.fundReceived.length; i++) {
+      profit = Number(Math.round((profit + formData.data.fundReceived[i].receivedAmount) * 100) / 100)
+    }
+  }
+  if (formData.data.payment && formData.data.payment.length > 0) {
+    for (let i = 0; i < formData.data.payment.length; i++) {
+      profit = Number(Math.round((profit - formData.data.payment[i].amount) * 100) / 100)
+    }
+  }
+  return profit
+}
+const clickDetail = (row) => {
+  orderDetail.value = row
+  dialogVisible.value = true
+}
+const computeMoney = (item) => {
+  let money = 0
+  if (item.customizeProcessingPrice > 0 && item.quantity > 0) {
+    money = Number(Math.round((money + item.customizeProcessingPrice * item.quantity) * 100) / 100)
+  }
+  return money
+}
+const packagingSubtotal = (item) => {
+  let money = 0
+  if (item.salesPrice && item.quantity) {
+    let price = Number(item.salesPrice)
+    money = Number(Math.round(price * item.quantity * 100) / 100)
+  } else {
+    money = 0
+  }
+  return money
+}
+const packagingTotal = () => {
+  let money = 0
+  if (orderDetail.value.packagingList && orderDetail.value.packagingList.length > 0) {
+    for (let i = 0; i < orderDetail.value.packagingList.length; i++) {
+      money = Number(Math.round((money + packagingSubtotal(orderDetail.value.packagingList[i])) * 100) / 100)
+    }
+  }
+  return money
+}
+const goodsTotal = () => {
+  let money = 0
+  if (orderDetail.value.orderItemList && orderDetail.value.orderItemList.length > 0) {
+    for (let i = 0; i < orderDetail.value.orderItemList.length; i++) {
+      if (orderDetail.value.orderItemList[i].paymentPrice) {
+        money = Number(Math.round((money + Number(orderDetail.value.orderItemList[i].paymentPrice)) * 100) / 100)
+      }
+    }
+  }
+  return money
+}
+const orderTotal = () => {
+  let money = Number(Math.round((goodsTotal() + packagingTotal()) * 100) / 100)
+  return money
+}
+const dictKeyValue = (value, arr) => {
+  if ((value || value === 0) && arr) {
+    value = value + ''
+    const current = arr.find((x) => x.value == value)
+    if (current != undefined && current.label) {
+      return current.label
+    }
+    return ''
+  }
+  return ''
+}
+const emit = defineEmits(['clickCancel'])
+const clickSettlement = () => {
+  ElMessageBox.confirm('你是否确认结算利润', '提示', {
+    confirmButtonText: '确定',
+    cancelButtonText: '取消',
+    type: 'warning'
+  })
+    .then(() => {
+      settlementProfit({ id: props.rowData.id, hasSettlement: 1, settlementProfit: calculateTotalProfit() }).then(() => {
+        ElMessage({
+          type: 'success',
+          message: '结算成功'
+        })
+        emit('clickCancel', true)
+      })
+    })
+    .catch(() => {})
+}
+onMounted(() => {
+  getListByCodeApi({ code: 'expense_type' }).then((res) => {
+    expenseType.value = res
+  })
+  getFundReceived({ contractId: props.rowData.id }).then((res) => {
+    formData.data.fundReceived = res
+  })
+  getPayment({ contractId: props.rowData.id }).then((res) => {
+    formData.data.payment = res
+  })
+  getOrderList({ contractId: props.rowData.id }).then((res) => {
+    formData.data.order = res
+  })
+})
+</script>
+
+<style lang="scss" scoped></style>

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

@@ -495,10 +495,10 @@ function formSubmit() {
         ElMessage.error('请款明细存在费用类型为空,无法提交')
         return
       }
-      if (!item.contractId) {
-        ElMessage.error('请款明细存在关联合同为空,无法提交')
-        return
-      }
+      // if (!item.contractId) {
+      //   ElMessage.error('请款明细存在关联合同为空,无法提交')
+      //   return
+      // }
       if (!item.remark) {
         ElMessage.error('请款明细存在款项说明为空,无法提交')
         return