levelOneMonth.vue
5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<template>
<div class="from-Card">
<el-form ref="queryRef" size="small" :model="queryParams" inline label-position="top">
<el-row style="width: 100%;">
<el-col :span="4">
<el-form-item label="年度">
<el-date-picker
v-model="queryParams.year"
:clearable="false"
style="width: 100%"
type="year"
value-format="YYYY"
@change="handleQuery"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="月份">
<el-select v-model="queryParams.month" style="width: 100%" @change="handleQuery">
<el-option label="一月" value="1" />
<el-option label="二月" value="2" />
<el-option label="三月" value="3" />
<el-option label="四月" value="4" />
<el-option label="五月" value="5" />
<el-option label="六月" value="6" />
<el-option label="七月" value="7" />
<el-option label="八月" value="8" />
<el-option label="九月" value="9" />
<el-option label="十月" value="10" />
<el-option label="十一月" value="11" />
<el-option label="十二月" value="12" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="是否达标">
<el-select v-model="queryParams.isStandard" clearable style="width: 100%" @change="handleQuery">
<el-option label="达标" value="1" />
<el-option label="未达标" value="0" />
</el-select>
</el-form-item>
</el-col>
<div class="po-r-btns">
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
<el-button type="success" plain icon="Download" @click="handleExport">导出</el-button>
</div>
</el-row>
</el-form>
</div>
<div class="table">
<el-table v-loading="loading" height="700" :data="tableList" border stripe>
<el-table-column type="index" width="55" align="center" label="序号" />
<el-table-column label="单位会员" align="center" prop="deptName" min-width="200" show-overflow-tooltip />
<el-table-column label="约定数量" align="center" prop="promiseNum" />
<el-table-column label="约定金额" align="center" prop="promiseAmount" />
<el-table-column label="服务数量(人/年)" align="center" prop="realNum" />
<el-table-column label="完成比" align="center" prop="percent" />
<el-table-column label="月度是否达标" align="center" prop="isStandard" />
<el-table-column label="月度应支付金额" align="center" prop="amount" />
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<span>{{ scope.row.attr1==1?'已下载' : ['/','未确认','已确认','已上传','已打款'][scope.row.status] }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="200">
<template #default="scope">
<el-button type="primary" :disabled="!(scope.row.status>2 && scope.row.file)" @click="handleDownload(scope.row)">下载发票</el-button>
<el-button type="warning" :disabled="!(scope.row.status==2||scope.row.status==3)" @click="handleSure(scope.row)">确认打款</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script setup>
import { reactive, ref, getCurrentInstance } from 'vue'
import dayjs from 'dayjs'
import { getLevelOneMonth } from '@/api/report/business'
import { updateBusinessData, doDown } from '@/api/report/businessData'
import { downloadFile } from '@/utils/ruoyi'
const { proxy } = getCurrentInstance()
const queryParams = reactive({
year: `${dayjs().year()}`,
month: `${dayjs().month() + 1}`,
isStandard: undefined
})
const loading = ref(false)
const tableList = ref([])
function init() {
handleQuery()
}
function handleQuery() {
loading.value = true
getLevelOneMonth(queryParams).then(res => {
tableList.value = res.data
}).catch(() => {
tableList.value = []
}).finally(() => {
loading.value = false
})
}
function resetQuery() {
queryParams.year = `${dayjs().year()}`
queryParams.month = `${dayjs().month() + 1}`
queryParams.isStandard = undefined
handleQuery()
}
function handleSure(row) {
proxy.$modal.confirm('是否确认打款?').then(() => {
updateBusinessData({
id: row.reportId,
status: 4
}).then(() => {
row.status = 4
proxy.$modal.msgSuccess('操作成功')
})
})
}
async function handleDownload(row) {
const fileObj = JSON.parse(row.file)
window.open(downloadFile(fileObj[0].url), '_self')
await doDown(row.reportId)
row.attr1 = 1
}
function handleExport() {
proxy.download('/report/exportLevelOneMonth', {
...queryParams
}, `中跆协${queryParams.year}年${queryParams.month}月业务${new Date().getTime()}.xlsx`)
}
defineExpose({
init
})
</script>
<style scoped>
</style>