Procházet zdrojové kódy

产值审核添加角标和填报保留两位小数

songxy před 10 měsíci
rodič
revize
b0a7d2973a

+ 36 - 15
client/src/views/OaSystem/marketCenter/projectCheck/index.vue

@@ -10,7 +10,7 @@
         :class="{ active: currentTab === item['key'] }"
         @click="switchTabHandle(item)"
       >
-        {{ item['name'] }}
+        {{ item['name'] }}({{ item['value'] }})
       </li>
     </ul>
     <div class="tableBox">
@@ -27,7 +27,6 @@
             height: '50px'
           }"
           @selection-change="handleSelectionChange"
-          v-loading="loading"
         >
           <el-table-column v-if="currentTab === '0'" type="selection" width="55" />
           <el-table-column label="序号" width="100" align="center">
@@ -168,16 +167,19 @@ const dataSource = ref([])
 type TabType = {
   name: string
   key: string
+  value: number
 }
 const currentTab = ref<string>('0')
 const tabList = ref<TabType[]>([
   {
     name: '待审核',
-    key: '0'
+    key: '0',
+    value: 0
   },
   {
     name: '已审核',
-    key: '1'
+    key: '1',
+    value: 0
   }
 ])
 const switchTabHandle = (item: TabType) => {
@@ -193,31 +195,43 @@ const tableRef: any = ref(null)
 const tableHeight: any = ref(0)
 const message = useMessage()
 
-const loading = ref(false)
-const getProjectCheckByList = async () => {
-  loading.value = true
+//待审核
+const getProjectCheckListAjax = async () => {
   const result: any = await request.get(
     {
       url: '/projectReport/list-check'
     },
     '/business'
   )
+  return result
+}
+const getProjectCheckByList = async () => {
+  const result: any = await getProjectCheckListAjax()
   dataSource.value = result ?? []
-  loading.value = false
 }
-
-const getProjectCheckedByList = async () => {
-  loading.value = true
-  const result: any = await request.get(
+const getProjectCheckByCount = async () => {
+  const result: any = await getProjectCheckListAjax()
+  result && (tabList.value[0]['value'] = result.length)
+}
+//已审核
+const getProjectCheckedListAjax = async () => {
+  return await request.get(
     {
       url: '/projectReport/list-checked'
     },
     '/business'
   )
+}
+const getProjectCheckedByList = async () => {
+  const result: any = await getProjectCheckedListAjax()
   dataSource.value = result ?? []
-  loading.value = false
 }
-
+const getProjectCheckedByCount = async () => {
+  const result: any = await getProjectCheckedListAjax()
+  result && (tabList.value[1]['value'] = result.length)
+}
+getProjectCheckByCount()
+getProjectCheckedByCount()
 const passProjectReportHandle = async (data: any) => {
   const result: any = await request.post(
     {
@@ -229,6 +243,8 @@ const passProjectReportHandle = async (data: any) => {
   if (result) {
     message.success('通过成功!')
     getProjectCheckByList()
+    getProjectCheckByCount()
+    getProjectCheckedByCount()
   }
 }
 const selections = ref<any>([])
@@ -256,6 +272,8 @@ const passBatchProjectReportHandle = async () => {
   if (result) {
     message.success('批量审核成功!')
     getProjectCheckByList()
+    getProjectCheckByCount()
+    getProjectCheckedByCount()
   }
 }
 const handleSelectionChange = (arr) => {
@@ -289,11 +307,14 @@ const rejectProjectReportHandle = async () => {
   if (result) {
     message.success('驳回成功!')
     getProjectCheckByList()
+    getProjectCheckByCount()
+    getProjectCheckedByCount()
   }
 }
 const auditorVisiabled = ref<boolean>(false)
-const activities = ref<any[]>([])
 
+//审核记录
+const activities = ref<any[]>([])
 const getProjectReportAuditList = async (row: { reportId: string }) => {
   const result: any = await request.get(
     {

+ 7 - 4
client/src/views/OaSystem/marketCenter/projectReport/index.vue

@@ -44,7 +44,7 @@
           </el-table-column>
           <el-table-column label="现进度" width="220" align="center">
             <template #default="scope">
-              <span v-if="!scope.row.isEditor">{{ scope.row.reportProgress }}%</span>
+              <span v-if="!scope.row.isEditor">{{ scope.row.reportProgress ?? 0 }}%</span>
               <el-input
                 v-else
                 v-model="scope.row.reportProgress"
@@ -236,9 +236,12 @@ const commitProjectReport = async (row: { reportId: string }) => {
 }
 const reportProgressHandle = (row) => {
   if (row.reportProgress) {
-    row.periodValue = ((row.reportProgress - row.finishProgress) / 100) * row.virtualAmount
-    row.surplusValue = ((100 - row.reportProgress) / 100) * row.virtualAmount
-    row.periodCheckValue = row.shareRatio * row.periodValue
+    row.periodValue = (
+      ((row.reportProgress - row.finishProgress) / 100) *
+      row.virtualAmount
+    ).toFixed(2)
+    row.surplusValue = (((100 - row.reportProgress) / 100) * row.virtualAmount).toFixed(2)
+    row.periodCheckValue = (row.shareRatio * row.periodValue).toFixed(2)
   }
 }
 const editorHandle = async (row) => {