Browse Source

Merge branch 'master' of http://8.149.142.40:3000/fjhx2012/jy_erp

lxf 2 months ago
parent
commit
b43aa7effd

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

@@ -602,7 +602,7 @@ function handleRemove(idList: string[]) {
         <el-tab-pane label="交易明细" name="2">
           <TransactionDetail :rowData="formData"></TransactionDetail>
         </el-tab-pane>
-        <el-tab-pane label="订单明细" name="3">
+        <el-tab-pane label="结算账目" name="3">
           <OrderDetail :rowData="formData"></OrderDetail>
         </el-tab-pane>
       </el-tabs>

+ 30 - 7
jy-ui/src/views/business/contract/info/order-detail.vue

@@ -13,11 +13,18 @@
         </el-table-column>
         <el-table-column label="订单金额" prop="paymentPrice" />
         <el-table-column label="三梵成本" prop="costAmount" />
-        <el-table-column label="预计利润" prop="expectedProfit" />
+        <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" />
@@ -173,6 +180,7 @@
 
 <script setup>
 import { getFundReceived, getPayment, getOrderList } from '@/api/business/contract/info'
+import { getListByCodeApi } from '@/api/system/dictData'
 
 const { proxy } = getCurrentInstance()
 const props = defineProps({
@@ -190,16 +198,17 @@ const orderDetail = ref({
   orderItemList: [],
   packagingList: []
 })
+const expenseType = ref([])
 const calculateTotalProfit = () => {
   let profit = 0
-  if (orderDetail.fundReceived && orderDetail.fundReceived.length > 0) {
-    for (let i = 0; i < orderDetail.fundReceived.length; i++) {
-      profit = Number(Math.round((profit + orderDetail.fundReceived[i].receivedAmount) * 100) / 100)
+  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 (orderDetail.payment && orderDetail.payment.length > 0) {
-    for (let i = 0; i < orderDetail.payment.length; i++) {
-      profit = Number(Math.round((profit - orderDetail.payment[i].amount) * 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
@@ -249,7 +258,21 @@ 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 ''
+}
 onMounted(() => {
+  getListByCodeApi({ code: 'expense_type' }).then((res) => {
+    expenseType.value = res
+  })
   getFundReceived({ contractId: props.rowData.id }).then((res) => {
     formData.data.fundReceived = res
   })