|
@@ -1,11 +1,194 @@
|
|
|
-<script setup>
|
|
|
+<template>
|
|
|
+ <van-row style="margin-top: 20px" @click="dateScreenShow = true">
|
|
|
+ <van-col :span="24">
|
|
|
+ <van-cell-group>
|
|
|
+ <van-cell size="large" class="checkCell" title-class="projectTitle">
|
|
|
+ <template #title>
|
|
|
+ <van-text-ellipsis :content="projectName"/>
|
|
|
+ </template>
|
|
|
+ <template #value>
|
|
|
+ <van-row justify="end">
|
|
|
+ <van-col class="resetPaymentCell" @click.stop="resetPayment">
|
|
|
+ <van-icon name="replay" />
|
|
|
+ <van-text-ellipsis content="重置" />
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ </van-cell-group>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-cell-group class="paymentCellGroup">
|
|
|
+ <van-cell
|
|
|
+ v-for="item in paymentList"
|
|
|
+ :key="item.ID"
|
|
|
+ class="paymentCell">
|
|
|
+ <template #title>
|
|
|
+ <van-text-ellipsis :content="serialNumber(item.serialNumber)"/>
|
|
|
+ </template>
|
|
|
+ <template #value>
|
|
|
+ <van-text-ellipsis :content="collectionAmount(item.collectionPrice)"/>
|
|
|
+ </template>
|
|
|
+ <template #label>
|
|
|
+ <van-text-ellipsis :content="collectionTime(item.collectionTime)"/>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ </van-cell-group>
|
|
|
+ <van-pagination
|
|
|
+ v-model="projectPaymentBody.pageInfo.page"
|
|
|
+ :total-items="paymentTotal"
|
|
|
+ :items-per-page="8"
|
|
|
+ force-ellipses
|
|
|
+ @change="checkPayment"
|
|
|
+ class="pagination"
|
|
|
+ />
|
|
|
+ <van-popup
|
|
|
+ v-model:show="dateScreenShow"
|
|
|
+ position="bottom"
|
|
|
+ style="height: 70vh"
|
|
|
+ closeable
|
|
|
+ close-icon-position="top-right"
|
|
|
+ >
|
|
|
+ <van-row style="margin-top: 8vh">
|
|
|
+ <van-col :span="22" :offset="1">
|
|
|
+ <el-form label-width="70" label-position="left" size="large">
|
|
|
+ <el-form-item label="项目:" size="large">
|
|
|
+ <el-select
|
|
|
+ placeholder="请选择项目"
|
|
|
+ v-model="projectPaymentBody.code"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in useFinance.allProject"
|
|
|
+ :key="item.ID"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.code"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="月份:"
|
|
|
+ >
|
|
|
+ <el-date-picker
|
|
|
+ v-model="projectPaymentBody.time"
|
|
|
+ type="month"
|
|
|
+ placeholder="请选择月份"
|
|
|
+ format="YYYY-MM"
|
|
|
+ value-format="YYYY-MM"
|
|
|
+ clearable
|
|
|
+ @clear="projectPaymentBody.time = ''"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row style="margin-top: 3vh">
|
|
|
+ <van-col :span="22" :offset="1">
|
|
|
+ <van-row justify="end">
|
|
|
+ <van-col>
|
|
|
+ <van-button @click="checkPayment" type="primary">查询</van-button>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ </van-popup>
|
|
|
+</template>
|
|
|
|
|
|
+<script setup>
|
|
|
+import { useFinanceStore } from '@/pinia/finance/finance'
|
|
|
+import { retrievalCollection } from '@/api/collection'
|
|
|
+import moment from "moment"
|
|
|
+defineOptions({
|
|
|
+ name: 'projectCost',
|
|
|
+})
|
|
|
+const useFinance = useFinanceStore()
|
|
|
+// 检索
|
|
|
+const dateScreenShow = ref(false)
|
|
|
+const projectPaymentBody = reactive({
|
|
|
+ pageInfo: {
|
|
|
+ page: 1,
|
|
|
+ pageSize: 8
|
|
|
+ },
|
|
|
+ code: '',
|
|
|
+ time: ''
|
|
|
+})
|
|
|
+const paymentList = reactive([])
|
|
|
+const checkPayment = () => {
|
|
|
+ retrievalCollection(projectPaymentBody).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ dateScreenShow.value = false
|
|
|
+ useFinance.changeCurrentCode(projectPaymentBody.code)
|
|
|
+ const list = res.data.list
|
|
|
+ paymentList.length = 0
|
|
|
+ paymentList.push(...list)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+onMounted(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ const info = useFinance.costInfo
|
|
|
+ const payment = info.collection
|
|
|
+ paymentList.length = 0
|
|
|
+ paymentList.push(...payment)
|
|
|
+ projectPaymentBody.code = useFinance.currentCode
|
|
|
+ },500)
|
|
|
+})
|
|
|
+// 重置
|
|
|
+const resetPayment = () => {
|
|
|
+ const all = useFinance.allProject
|
|
|
+ const condition = {
|
|
|
+ pageInfo: {
|
|
|
+ page: 1,
|
|
|
+ pageSize: 8
|
|
|
+ },
|
|
|
+ code: all[0].code,
|
|
|
+ time: ''
|
|
|
+ }
|
|
|
+ Object.assign(projectPaymentBody,condition)
|
|
|
+ checkPayment()
|
|
|
+}
|
|
|
+// 分页
|
|
|
+const paymentTotal = ref(0)
|
|
|
+// 计算属性..................
|
|
|
+const projectName = computed(() => {
|
|
|
+ return "项目:" + useFinance.currentName
|
|
|
+})
|
|
|
+// 单号
|
|
|
+const serialNumber = computed(() => {
|
|
|
+ return (number) => "单号:" + number
|
|
|
+})
|
|
|
+// 收款金额
|
|
|
+const collectionAmount = computed(() => {
|
|
|
+ return (amount) => "金额:" + amount
|
|
|
+})
|
|
|
+// 收款时间
|
|
|
+const collectionTime = computed(() => {
|
|
|
+ return (time) => moment(time).format("YYYY-MM-DD")
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
-<template>
|
|
|
-
|
|
|
-</template>
|
|
|
+<style scoped lang="less">
|
|
|
+.checkCell{
|
|
|
+ height: 45px;
|
|
|
+ font-size: 16px;
|
|
|
+ .projectTitle{
|
|
|
+ width: 200px;
|
|
|
+ }
|
|
|
+ .resetPaymentCell {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
-<style scoped>
|
|
|
+.paymentCellGroup{
|
|
|
+ margin-top: 20px;
|
|
|
+ height: 512px;
|
|
|
+ .paymentCell{
|
|
|
+ height: 64px;
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
+.pagination{
|
|
|
+ margin-top: 25px;
|
|
|
+ margin-bottom: 25px;
|
|
|
+}
|
|
|
</style>
|