From 7eca0ab1b6d5142d623efd471985b2a20b559616 Mon Sep 17 00:00:00 2001
From: 小飞侠 <8277136+liaoxujun@user.noreply.gitee.com>
Date: 星期一, 01 十二月 2025 10:55:02 +0800
Subject: [PATCH] 修正审批备注长度

---
 AdminwebPages/adminpageView/src/views/cylsgPayrollReport.vue |  419 ++++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 256 insertions(+), 163 deletions(-)

diff --git a/AdminwebPages/adminpageView/src/views/cylsgPayrollReport.vue b/AdminwebPages/adminpageView/src/views/cylsgPayrollReport.vue
index 081f7a0..df466bb 100644
--- a/AdminwebPages/adminpageView/src/views/cylsgPayrollReport.vue
+++ b/AdminwebPages/adminpageView/src/views/cylsgPayrollReport.vue
@@ -3,7 +3,7 @@
  * @Author: 灏忛渚�
  * @Date: 2025-03-17 09:45:10
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2025-03-27 13:24:58
+ * @LastEditTime: 2025-10-24 17:12:56
  * Copyright: 2025  MinTinge CO.,LTD. All Rights Reserved.
  * @Descripttion: 鍐欏叆浣犵殑鎻忚堪
 -->
@@ -18,64 +18,74 @@
 -->
 <!-- -->
 <template>
-  <div style="max-width: 1440px; margin: 0 auto">
-
+  <div style=" margin: 0 auto">
     <el-card>
       <PlusForm v-model="formdata" :columns="FromColumns" :row-props="{ gutter: 100 }" :col-props="{
-        span: 5
+        span: 5,
       }" @submit="mysubmit">
         <template #footer="{ handleSubmit }">
           <div style="margin: 0 auto">
             <el-button type="primary" @click="handleSubmit">鎼滅储</el-button>
+
+            <el-button type="error" @click="RePayFun" :disabled="!canRePay">閲嶆柊鏀粯</el-button>
           </div>
         </template>
       </PlusForm>
     </el-card>
     <PlusTable ref="plusTableInstance" :columns="tableConfig" :table-data="tableData" table-title="琛ㄦ牸" show-summary
-      :summary-method="getSummaries" :pagination="{ total, modelValue: pageInfo }"
-      @paginationChange="handlePaginationChange" adaptive />
+      :summary-method="getSummaries"
+      :pagination="{ total, modelValue: pageInfo, pageSizeList: [30, 40, 50, 100, 200, 300, 400, 500] }"
+      @paginationChange="handlePaginationChange" adaptive :is-selection="true" has-index-column
+      @selection-change="handleSelectionChange" row-key="id" />
+
   </div>
 </template>
-<script setup lang='tsx'>
-import { GetTransferOrder, OrderByType, type WeChatTransferOrder } from '@/Api/apis';
-import moment from 'moment';
-import type { PlusColumn, PlusTableInstance, PageInfo } from 'plus-pro-components'
+<script setup lang="tsx">
+import {
+  GetTransferOderOfMain,
+  GetTransferOrder,
+  OrderByType,
+  ReSendCreadTransferMoney,
+  type WeChatTransferOrder,
+} from '@/Api/apis'
+import { ElMessage } from 'element-plus'
+import moment from 'moment'
+import type { PageInfo, PlusColumn } from 'plus-pro-components'
 import { useTable } from 'plus-pro-components'
-import { h, onMounted, ref, type VNode } from 'vue'
+import { computed, h, onMounted, ref, watch, type VNode } from 'vue'
 const formdata = ref<WeChatTransferOrder>({
   userName: null,
   userIDCode: null,
   DataTime: [],
-  itCode: null
-
+  itCode: null,
+  isSetOK: null,
+  hasSendOk: null,
+  createDataTime: [],
 })
-
+const multipleSelection = ref<WeChatTransferOrder[]>([])
 const FromColumns: PlusColumn[] = [
   {
     label: '濮撳悕',
     prop: 'userName',
     labelWidth: 60,
-
   },
   {
     label: '韬唤璇佸彿鐮�',
     labelWidth: 100,
 
-    prop: 'userIDCode'
-  }
-  ,
+    prop: 'userIDCode',
+  },
   {
     label: '鐢佃瘽鍙风爜',
     labelWidth: 100,
-
-    prop: 'itCode'
+    prop: 'itCode',
   },
   {
-    label: '鏀粯鏃堕棿',
+    label: '鏇存柊鏃堕棿',
     labelWidth: 100,
     width: 400,
     colProps: {
-      span: 8
+      span: 8,
     },
     prop: 'DataTime',
     valueType: 'date-picker',
@@ -85,195 +95,279 @@
       endPlaceholder: '璇烽�夋嫨缁撴潫鏃堕棿',
       rangeSeparator: '-',
       valueFormat: 'YYYY-MM-DDTHH:mm:ss',
-
     },
-
-
-
-  }
+  },
+  {
+    label: '鍒涘缓鏃堕棿',
+    labelWidth: 100,
+    width: 400,
+    colProps: {
+      span: 8,
+    },
+    prop: 'createDataTime',
+    valueType: 'date-picker',
+    fieldProps: {
+      type: 'datetimerange',
+      startPlaceholder: '璇烽�夋嫨寮�濮嬫椂闂�',
+      endPlaceholder: '璇烽�夋嫨缁撴潫鏃堕棿',
+      rangeSeparator: '-',
+      valueFormat: 'YYYY-MM-DDTHH:mm:ss',
+    },
+  },
+  {
+    label: '鏀粯澶辫触',
+    labelWidth: 100,
+    prop: 'hasSendOk',
+    valueType: 'switch',
+  },
 ]
 
-const tableConfig = ref<PlusColumn[]>(
-  [
-    {
-      label: '濮撳悕',
-      prop: 'userName',
-      width: 80
+const canRePay = computed(() => {
+  // 蹇呴』鏈夐�変腑椤癸紝涓旀墍鏈夐�変腑椤圭殑hasSendOk閮戒负true锛堟敮浠樺け璐ワ級
+  return multipleSelection.value.length > 0 &&
+    formdata.value.hasSendOk == true
+})
+const tableConfig = ref<PlusColumn[]>([
+  {
+    label: '濮撳悕',
+    prop: 'userName',
+    width: 70,
+  },
+  {
+    label: '韬唤璇�',
+    prop: 'userIDCode',
+    width: 162,
+  },
+  {
+    label: '鐢佃瘽鍙风爜',
+    prop: 'itCode',
+    width: 110,
+  },
+
+  {
+    width: 100,
+    label: '鎬婚搴�',
+    prop: 'totalAmount',
+    render: (value) => {
+      let formattedAmount = ((value ?? 0) / 100).toLocaleString('zh-CN', {
+        style: 'currency',
+        currency: 'CNY',
+      })
+
+      return <span>{formattedAmount}鍏� </span>
     },
-    {
-      label: '韬唤璇�',
-      prop: 'userIDCode',
-      width: 170
+  },
 
+  {
+    width: 100,
+    label: '鎴愬姛棰濆害',
+    prop: 'successAmount',
+    sortable: true,
+    render: (value) => {
+      let formattedAmount = ((value ?? 0) / 100).toLocaleString('zh-CN', {
+        style: 'currency',
+        currency: 'CNY',
+      })
 
+      return <span>{formattedAmount}鍏� </span>
     },
-    {
-      label: '鐢佃瘽鍙风爜',
-      prop: 'itCode',
-      width: 120
+  },
+  {
+    width: 100,
+    label: '澶辫触棰濆害',
+    prop: 'failAmount',
+    sortable: true,
+    render: (value) => {
+      let formattedAmount = ((value ?? 0) / 100).toLocaleString('zh-CN', {
+        style: 'currency',
+        currency: 'CNY',
+      })
+
+      return <span>{formattedAmount}鍏� </span>
     },
+  },
 
-
-    {
-      width: 100,
-      label: '鎬婚搴�',
-      prop: 'totalAmount',
-      render: (value) => {
-
-        let formattedAmount = ((value ?? 0) / 100).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
-
-        return <span>{formattedAmount}鍏�</span>
-      }
-
-
+  {
+    width: 160,
+    label: '鏇存柊鏃堕棿',
+    prop: 'upDataTime',
+    render: (value) => {
+      return <span>{moment(value).format('YYYY-MM-DD HH:mm:ss')} </span>
     },
-
-    {
-      width: 100,
-      label: '鎴愬姛棰濆害',
-      prop: 'successAmount',
-      sortable: true,
-      render: (value) => {
-
-        let formattedAmount = ((value ?? 0) / 100).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
-
-        return <span>{formattedAmount}鍏�</span>
-      }
-
+  },
+  {
+    width: 160,
+    label: '鍒涘缓鏃堕棿',
+    prop: 'createTime',
+    render: (value) => {
+      return <span>{moment(value).format('YYYY-MM-DD HH:mm:ss')} </span>
     },
-    {
-      width: 100,
-      label: '澶辫触棰濆害',
-      prop: 'failAmount',
-      sortable: true,
-      render: (value) => {
+  },
 
-        let formattedAmount = ((value ?? 0) / 100).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
-
-        return <span>{formattedAmount}鍏�</span>
-      }
-
+  {
+    width: 80,
+    label: '琛ュ彂鍗�',
+    prop: 'weChatTransferOrderPrId',
+    render: (value) => {
+      const color = value > 0 ? 'red' : 'green';
+      return <span style={{ color }}>{value ? `鏄�${value}` : '鍚�'} </span>
     },
+  },
+  {
+    label: '鑵捐鍗曞彿',
+    prop: 'batchId',
+  },
+  {
+    label: '瀹㈡埛鍗曞彿',
+    prop: 'outBatchNumber',
+  },
+  {
+    width: 160,
+    label: '鎬诲伐璧�',
+    prop: 'zhongGz',
+    render: (value) => {
+      let formattedAmount = (value ?? 0).toLocaleString('zh-CN', {
+        style: 'currency',
+        currency: 'CNY',
+      })
 
-    {
-      width: 180,
-      label: '鎻愮幇鏃堕棿',
-      prop: 'upDataTime',
-      render: (value) => {
-        return <span>{moment(value).format('YYYY-MM-DD HH:mm:ss')}</span>
-      }
-
+      return <span>{formattedAmount}鍏� </span>
     },
-    {
+  },
+  {
+    width: 160,
+    label: '宸叉彁宸ヨ祫',
+    prop: 'yiTiXianGz',
+    render: (value) => {
+      let formattedAmount = (value ?? 0).toLocaleString('zh-CN', {
+        style: 'currency',
+        currency: 'CNY',
+      })
 
-      label: '鑵捐鍗曞彿',
-      prop: 'batchId'
-
+      return <span>{formattedAmount}鍏� </span>
     },
-    {
-
-      label: '瀹㈡埛鍗曞彿',
-      prop: 'outBatchNumber'
-
-    },
-    {
-      width: 100,
-      label: '鎬诲伐璧�',
-      prop: 'zhongGz',
-      render: (value) => {
-
-        let formattedAmount = ((value ?? 0)).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
-
-        return <span>{formattedAmount}鍏�</span>
-      }
-
-    },
-    {
-      width: 100,
-      label: '宸叉彁宸ヨ祫',
-      prop: 'yiTiXianGz',
-      render: (value) => {
-        let formattedAmount = ((value ?? 0)).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
-
-        return <span>{formattedAmount}鍏�</span>
-      }
-
-    }
-
-  ]
-);
-
+  },
+])
+const handleSelectionChange = (val: WeChatTransferOrder[]) => {
+  multipleSelection.value = val
+}
 const { tableData, pageInfo, total, loadingStatus } = useTable<WeChatTransferOrder[]>()
+pageInfo.value.page = 1;
+pageInfo.value.pageSize = 40;
 
 onMounted(() => {
-  getList();
+  getList()
 })
 const getList = async () => {
   loadingStatus.value = true
-  if (formdata.value.DataTime && Array.isArray(formdata.value.DataTime) && formdata.value.DataTime.length === 2) {
-    debugger
-    formdata.value.upDataTime = `${formdata.value.DataTime[0]}~${formdata.value.DataTime[1].toString()}`;
-  } else {
 
+  if (
+    formdata.value.DataTime &&
+    Array.isArray(formdata.value.DataTime) &&
+    formdata.value.DataTime.length === 2
+  ) {
+    formdata.value.upDataTime = `${formdata.value.DataTime[0]}~${formdata.value.DataTime[1].toString()}`
+  } else {
+  }
+  if (
+    formdata.value.createDataTime &&
+    Array.isArray(formdata.value.createDataTime) &&
+    formdata.value.createDataTime.length === 2
+  ) {
+    formdata.value.createTime = `${formdata.value.createDataTime[0]}~${formdata.value.createDataTime[1].toString()}`
+  } else {
+  }
+  if (formdata.value.hasSendOk == true) {
+    // 鏀粯澶辫触鐨勮〃
+    GetTransferOderOfMain({
+
+      pageIndex: pageInfo.value.page,
+      pageSize: pageInfo.value.pageSize,
+      hasSendOk: false,
+      isSetOK: false
+    })
+      .then((res) => {
+        if (res.data.code == 1) {
+          tableData.value = (res.data?.data?.listdata ?? []) as WeChatTransferOrder[]
+
+          total.value = res.data.data?.page?.totalCount as number
+        }
+      })
+      .finally(() => {
+        loadingStatus.value = false
+      })
+    return
   }
   GetTransferOrder({
     page: { pageIndex: pageInfo.value.page, pageSize: pageInfo.value.pageSize },
-     where: JSON.stringify(formdata.value),
-     order:{
-       name:"upDataTime",
-       des:OrderByType.Desc
-     }
-
-  }).then((res) => {
-
-    if (res.data.code == 1) {
-      tableData.value = res.data.data?.data as WeChatTransferOrder[];
-
-      total.value = res.data.data?.page?.totalCount as number;
-    }
-  }).finally(() => {
-    loadingStatus.value = false
+    where: JSON.stringify(formdata.value),
+    order: {
+      name: 'upDataTime',
+      des: OrderByType.Desc,
+    },
   })
+    .then((res) => {
+      if (res.data.code == 1) {
+        tableData.value = res.data.data?.data as WeChatTransferOrder[]
 
+        total.value = res.data.data?.page?.totalCount as number
+      }
+    })
+    .finally(() => {
+      loadingStatus.value = false
+    })
+}
+const RePayFun = async () => {
+  if (multipleSelection.value.length == 0) {
+    ElMessage.error('璇烽�夋嫨瑕侀噸鏂版敮浠樼殑璁板綍')
+    return
+  }
+  let ids = multipleSelection.value.map((x) => x.id)
+  for (let index = 0; index < ids.length; index++) {
+    const element = ids[index]
+    await ReSendCreadTransferMoney(element as number)
+  }
+  ElMessage.success('鏀粯瀹屾瘯鍒锋柊鍒楄〃')
+  loadingStatus.value = false
 }
 
-
 const mysubmit = () => {
-  getList();
+  getList()
 }
 const getSummaries = (param: any) => {
   const { columns, data } = param
   const sums: (string | VNode)[] = []
-  columns.forEach((column: { property: string | number; }, index: number) => {
+  columns.forEach((column: { property: string | number }, index: number) => {
     if (index === 0) {
-      sums[index] = h('div', { style: { textDecoration: 'underline' } }, [
-        '缁熻',
-      ])
+      sums[index] = h('div', { style: { textDecoration: 'underline' } }, ['缁熻'])
       return
     }
-    if (column.property == "totalAmount") {
-      const values = data.map((x:any) => x.totalAmount);
-      let formattedAmount = (values.reduce((prev: any, cur: any) => prev + cur) / 100).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
+    if (column.property == 'totalAmount') {
+      const values = data.map((x: any) => x.totalAmount ?? 0)
+      let formattedAmount = (
+        values.reduce((prev: any, cur: any) => prev + cur) / 100
+      ).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' })
       sums[index] = formattedAmount
       return
     }
 
-
-    if (column.property == "successAmount") {
-      const values = data.map((x: { successAmount: any; }) => x.successAmount);
-      let formattedAmount = (values.reduce((prev: any, cur: any) => prev + cur) / 100).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
+    if (column.property == 'successAmount') {
+      const values = data.map((x: { successAmount: any }) => x.successAmount ?? 0)
+      let formattedAmount = (
+        values.reduce((prev: any, cur: any) => prev + cur) / 100
+      ).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' })
       sums[index] = formattedAmount
       return
     }
-    if (column.property == "failAmount") {
-      const values = data.map((x: { failAmount: any; }) => x.failAmount);
-      let formattedAmount = (values.reduce((prev: any, cur: any) => prev + cur) / 100).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
+    if (column.property == 'failAmount') {
+      const values = data.map((x: { failAmount: any }) => x.failAmount ?? 0)
+      let formattedAmount = (
+        values.reduce((prev: any, cur: any) => prev + cur) / 100
+      ).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' })
       sums[index] = formattedAmount
       return
     }
   })
-
-
 
   return sums
 }
@@ -281,6 +375,5 @@
   pageInfo.value = _pageInfo
   getList()
 }
-
 </script>
-<style lang='scss' scoped></style>
\ No newline at end of file
+<style lang="scss" scoped></style>

--
Gitblit v1.9.1