curry 1 éve
szülő
commit
8de9018674

+ 1 - 26
web/src/pinia/collection/Collection.js

@@ -1,6 +1,6 @@
 import { defineStore } from 'pinia'
 import { reactive, ref } from 'vue'
-import { createCollection, deleteCollection, updateCollection, retrievalCollection } from '@/api/collection'
+import { retrievalCollection } from '@/api/collection'
 import { formatDate } from '@/utils/formatDate'
 
 export const collectionOperate = defineStore('payment', () => {
@@ -14,34 +14,12 @@ export const collectionOperate = defineStore('payment', () => {
         const list = res.data.list
         list.forEach(item => {
           item.collectionTime = formatDate(item.collectionTime)
-          console.log(item.collectionTime)
         })
         paymentList.length = 0
         paymentList.push(...list)
       }
     })
   }
-  const postCollection = (data) => {
-    createCollection(data).then(res => {
-      if (res.code === 0) {
-        console.log(res.data)
-      }
-    })
-  }
-  const putCollection = (data) => {
-    updateCollection(data).then(res => {
-      if (res.code === 0) {
-        console.log(res.data)
-      }
-    })
-  }
-  const delCollection = (data) => {
-    deleteCollection(data).then(res => {
-      if (res.code === 0) {
-        console.log(res.data)
-      }
-    })
-  }
   const changePaymentList = (list) => {
     list.forEach(item => {
       item.collectionTime = formatDate(item.collectionTime)
@@ -57,9 +35,6 @@ export const collectionOperate = defineStore('payment', () => {
     paymentList,
     paymentTotal,
     getPaymentList,
-    postCollection,
-    putCollection,
-    delCollection,
     changePaymentList,
     changePaymentTotal
   }

+ 1 - 25
web/src/pinia/hour/Hour.js

@@ -1,5 +1,5 @@
 import { defineStore } from 'pinia'
-import { queryHour, createHour, updateHour, deleteHour } from '@/api/hour'
+import { queryHour } from '@/api/hour'
 import { reactive, ref } from 'vue'
 
 export const hourOperate = defineStore('time', () => {
@@ -17,27 +17,6 @@ export const hourOperate = defineStore('time', () => {
       }
     })
   }
-  const postTime = (data) => {
-    createHour(data).then(res => {
-      if (res.code === 0) {
-        console.log(res.data)
-      }
-    })
-  }
-  const putTime = (data) => {
-    updateHour(data).then(res => {
-      if (res.code === 0) {
-        console.log(res.data)
-      }
-    })
-  }
-  const delTime = (data) => {
-    deleteHour(data).then(res => {
-      if (res.code === 0) {
-        console.log(res.data)
-      }
-    })
-  }
   const changeTimeList = (list) => {
     timeList.length = 0
     timeList.push(...list)
@@ -50,9 +29,6 @@ export const hourOperate = defineStore('time', () => {
     timeList,
     timeTotal,
     getTimeList,
-    postTime,
-    putTime,
-    delTime,
     changeTimeList,
     changeTimeTotal
   }

+ 1 - 17
web/src/pinia/reimbursement/Reimbursement.js

@@ -1,5 +1,5 @@
 import { defineStore } from 'pinia'
-import { updateReimburse, deleteReimburse, retrievalReimburse } from '@/api/reimbursement'
+import { retrievalReimburse } from '@/api/reimbursement'
 import { reactive, ref } from 'vue'
 
 export const reimburseOperate = defineStore('account', () => {
@@ -16,20 +16,6 @@ export const reimburseOperate = defineStore('account', () => {
       }
     })
   }
-  const putReimburse = (data) => {
-    updateReimburse(data).then(res => {
-      if (res.code === 0) {
-        console.log(res.data)
-      }
-    })
-  }
-  const delReimburse = (data) => {
-    deleteReimburse(data).then(res => {
-      if (res.code === 0) {
-        console.log(res.data)
-      }
-    })
-  }
   const changeReimburseList = (list) => {
     reimburseList.length = 0
     reimburseList.push(...list)
@@ -41,8 +27,6 @@ export const reimburseOperate = defineStore('account', () => {
     reimburseList,
     reimburseTotal,
     getReimburseList,
-    putReimburse,
-    delReimburse,
     changeReimburseList,
     changeReimburseTotal
   }

+ 8 - 3
web/src/view/finance/components/hour.vue

@@ -143,7 +143,7 @@
 </template>
 
 <script setup>
-import { reactive, onMounted, ref } from 'vue'
+import {reactive, onMounted, ref, defineExpose } from 'vue'
 import { hourOperate } from '@/pinia/hour/Hour'
 import { codeOperate } from '@/pinia/code/code'
 import { queryConstructor, createWorkingHours } from '@/api/finance'
@@ -201,9 +201,7 @@ const addTime = () => {
       return
     }
   }
-  console.log(addCondition)
   createWorkingHours(addCondition).then(res => {
-    console.log(res)
     if (res.code === 0) {
       ElMessage.success('添加成功')
       addTimeShow.value = false
@@ -219,6 +217,13 @@ const changeHourPage = (page) => {
   condition.pageInfo.page = page
   retrievalTime()
 }
+const outsideChangePage = () => {
+  condition.pageInfo.page = 1
+}
+
+defineExpose({
+  outsideChangePage
+})
 </script>
 
 <style scoped>

+ 1 - 4
web/src/view/finance/components/payment.vue

@@ -222,7 +222,7 @@
 </template>
 
 <script setup>
-import { reactive, ref } from 'vue'
+import { reactive, ref, defineExpose } from 'vue'
 import { Search, Delete, Edit, Notebook, Plus } from '@element-plus/icons-vue'
 import { retrievalCollection, updateCollection, deleteCollection, createCollection } from '@/api/collection'
 import { collectionOperate } from '@/pinia/collection/Collection'
@@ -334,7 +334,6 @@ const paymentAdd = () => {
   const addData = paymentAddData
   addData.collectionPrice = addAmount.value.length === 0 ? 0 : parseFloat(addAmount.value)
   addData.projectCode = serial.currentCode
-  console.log(addData)
   for (const item in addData) {
     if (addData[item] === '' || addData[item] === 0) {
       ElMessage({
@@ -347,7 +346,6 @@ const paymentAdd = () => {
     }
   }
   createCollection(addData).then(res => {
-    console.log(res)
     const reset = condition
     reset.pageInfo.page = 1
     reset.code = serial.currentCode
@@ -373,7 +371,6 @@ const changePaymentPage = (page) => {
   pay.getPaymentList(pageCondition)
 }
 const outsideChangePage = () => {
-  console.log('父组件调用')
   condition.pageInfo.page = 1
 }
 

+ 10 - 4
web/src/view/finance/components/reimburse.vue

@@ -104,6 +104,7 @@
         </el-row>
         <el-row justify="end">
           <el-pagination
+            v-model:current-page="condition.pageInfo.page"
             background
             layout="prev, pager, next"
             :page-size="8"
@@ -310,7 +311,7 @@
         <el-row>
           <el-col :span="10">
             <el-form-item label="报销总金额:">
-              <el-text size="large">{{editTotality}}</el-text>
+              <el-text size="large">{{ editTotality }}</el-text>
             </el-form-item>
           </el-col>
         </el-row>
@@ -378,7 +379,7 @@
 
 <script setup>
 import { Search, Delete, Edit, Plus } from '@element-plus/icons-vue'
-import { reactive, ref, onMounted, computed } from 'vue'
+import { reactive, ref, onMounted, computed, defineExpose } from 'vue'
 import { reimburseOperate } from '@/pinia/reimbursement/Reimbursement'
 import { codeOperate } from '@/pinia/code/code'
 import { queryExpensesGenre } from '@/api/finance'
@@ -463,7 +464,6 @@ const searchReimburse = () => {
   submit.getReimburseList(condition)
 }
 const openReimburseEdit = (row) => {
-  console.log(row)
   reimburseEditShow.value = true
   Object.assign(editData, row)
 }
@@ -500,7 +500,6 @@ const addReimburse = () => {
   // // 报销总金额
   createData.reimbursementPrice = totality.value
   createData.projectCode = serial.currentCode
-  console.log(createData)
   for (const i in createData) {
     if (createData[i] === '' || createData[i] === 0) {
       ElMessage({
@@ -586,6 +585,13 @@ const delFeeDetails = () => {
   editData.feeDetails.splice(editData.feeDetails.length - 1, 1)
 }
 
+const outsideChangePage = () => {
+  condition.pageInfo.page = 1
+}
+
+defineExpose({
+  outsideChangePage
+})
 </script>
 
 <style scoped>

+ 12 - 8
web/src/view/finance/financeAnalysis/financeAnalysis.vue

@@ -112,19 +112,19 @@
             label="实施工时"
             :name="1"
           >
-            <Hour />
+            <Hour ref="hourOut"/>
           </el-tab-pane>
           <el-tab-pane
             label="费用报销"
             :name="2"
           >
-            <Reimburse />
+            <Reimburse ref="reimburseOut"/>
           </el-tab-pane>
           <el-tab-pane
             label="项目收款"
             :name="3"
           >
-            <payment ref="paymentRef" />
+            <payment ref="paymentOut" />
           </el-tab-pane>
         </el-tabs>
       </el-col>
@@ -249,13 +249,14 @@ import { getProjectList, getProjectMessage, queryProjectExpense } from '@/api/pr
 // import iconCollection from '@/assets/Collection.png'
 // import iconAmount from '@/assets/amount.png'
 import Hour from '../components/hour.vue'
-import Payment from '../components/payment.vue'
 import Reimburse from '../components/reimburse.vue'
 // 引入pinia
 import { collectionOperate } from '@/pinia/collection/Collection'
 import { codeOperate } from '@/pinia/code/code'
 import { reimburseOperate } from '@/pinia/reimbursement/Reimbursement'
 import { hourOperate } from '@/pinia/hour/Hour'
+// eslint-disable-next-line no-unused-vars
+import Payment from '@/view/finance/components/payment.vue'
 
 defineOptions({
   name: 'FinanceAnalysis'
@@ -293,7 +294,6 @@ const buttonType = computed(() => (state) => {
   }
   return obj[state]
 })
-
 const projectAmount = computed(() => {
   const price = ref(parseInt(projectMessage.price))
   // const price = ref(4892703)
@@ -332,13 +332,11 @@ const projectList = (condition) => {
 }
 const nameSearch = () => {
   condition.pageInfo.page = 1
-  console.log(condition)
   projectList(condition)
 }
 const changePage = (page) => {
   const search = condition
   search.pageInfo.page = page
-  console.log(search)
   projectList(search)
 }
 
@@ -350,6 +348,10 @@ const incomeExpenses = (code) => {
   listShow.value = false
 }
 
+const paymentOut = ref()
+const reimburseOut = ref()
+const hourOut = ref()
+
 const getMainMessage = (code) => {
   queryProjectExpense(code).then(res => {
     if (res.code === 0) {
@@ -360,7 +362,6 @@ const getMainMessage = (code) => {
         sum += parseFloat(item.collectionPrice)
       })
       projectSum.value = sum
-      console.log(projectSum.value)
       payment.changePaymentList(summaryData.collection)
       payment.changePaymentTotal(summaryData.collectionTotal)
       submit.changeReimburseList(summaryData.reimbursement)
@@ -375,6 +376,9 @@ const getMainMessage = (code) => {
         yearTime: '',
         people: 0
       })
+      paymentOut.value.outsideChangePage()
+      reimburseOut.value.outsideChangePage()
+      hourOut.value.outsideChangePage()
     }
   })
   getProjectMessage(code).then(res => {