myIndex.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <template>
  2. <div class="_ptbxBook">
  3. <div class="searchBox">
  4. <div class="form">
  5. <span class="formSpan">发票号码:</span>
  6. <el-input
  7. v-model="queryParams.commonCostNo"
  8. placeholder="请输入发票号码"
  9. style="width: 210px"
  10. />
  11. </div>
  12. <div class="form">
  13. <span class="formSpan">开票日期:</span>
  14. <el-date-picker
  15. v-model="queryParams.applyTime"
  16. type="daterange"
  17. unlink-panels
  18. range-separator="到"
  19. start-placeholder="开始日期"
  20. end-placeholder="结束日期"
  21. />
  22. </div>
  23. <div class="form">
  24. <span class="formSpan">合同编号:</span>
  25. <el-input
  26. v-model="queryParams.commonCostNo"
  27. placeholder="请输入合同编号"
  28. style="width: 210px"
  29. />
  30. </div>
  31. <div class="form">
  32. <span class="formSpan">合同名称:</span>
  33. <el-input
  34. v-model="queryParams.projectDeptId"
  35. placeholder="请输入合同名称"
  36. style="width: 160px"
  37. />
  38. </div>
  39. <div class="form">
  40. <span class="formSpan">项目编号:</span>
  41. <el-input
  42. v-model="queryParams.costType"
  43. placeholder="请输入项目编号"
  44. style="width: 160px"
  45. />
  46. </div>
  47. <div class="form">
  48. <span class="formSpan">项目名称:</span>
  49. <el-input v-model="queryParams.status" style="width: 160px" />
  50. </div>
  51. <div class="form">
  52. <span class="formSpan">付款单位:</span>
  53. <el-input
  54. v-model="queryParams.totalAmount"
  55. placeholder="请输入报销总金额"
  56. style="width: 160px"
  57. />
  58. </div>
  59. <div class="form">
  60. <span class="formSpan">回款日期:</span>
  61. <el-date-picker
  62. v-model="queryParams.applyTime"
  63. type="daterange"
  64. unlink-panels
  65. range-separator="到"
  66. start-placeholder="开始日期"
  67. end-placeholder="结束日期"
  68. />
  69. </div>
  70. <div class="form">
  71. <span class="formSpan">未回款金额:</span>
  72. <el-input
  73. v-model="queryParams.totalAmount"
  74. placeholder="请输入报销总金额"
  75. style="width: 160px"
  76. />
  77. </div>
  78. <div class="form">
  79. <span class="formSpan">开票状态:</span>
  80. <el-input v-model="queryParams.status" style="width: 160px" />
  81. </div>
  82. <div class="form">
  83. <span class="formSpan">开票金额:</span>
  84. <el-input
  85. v-model="queryParams.totalAmount"
  86. placeholder="请输入开票金额"
  87. style="width: 160px"
  88. />
  89. </div>
  90. <div class="form">
  91. <span class="formSpan">开票单位:</span>
  92. <el-input
  93. v-model="queryParams.totalAmount"
  94. placeholder="请输入开票金额"
  95. style="width: 160px"
  96. />
  97. </div>
  98. <div class="form" style="margin-right: 80px">
  99. <el-radio-group v-model="queryParams.isSign">
  100. <el-radio label="1">未回款</el-radio>
  101. </el-radio-group>
  102. </div>
  103. <div class="from">
  104. <div class="btnBox">
  105. <el-button type="primary" style="background: #3485ff" @click="handleQuery">
  106. <img src="@/assets/imgs/OA/search.png" class="mr-8px" alt="" />
  107. 查询</el-button
  108. >
  109. <el-button type="primary">
  110. <img src="@/assets/imgs/OA/open.png" class="mr-8px" alt="" />
  111. 导出</el-button
  112. >
  113. </div>
  114. </div>
  115. </div>
  116. <div class="infoBox">
  117. <ul>
  118. <li v-for="(item, index) in infoList" :key="index" class="mr-40px">
  119. <p>{{ item.name }}:</p>
  120. <h4 class="font-size-18px">{{ item.num }}</h4>
  121. </li>
  122. </ul>
  123. </div>
  124. <div class="tableBox">
  125. <div class="table" ref="tableRef">
  126. <el-table
  127. v-loading="loading"
  128. :data="list"
  129. style="width: 100%; height: 100%"
  130. :style="{ height: tableHeight + 'px' }"
  131. :header-cell-style="{
  132. background: '#F7F8FA',
  133. color: '#121518',
  134. height: '50px'
  135. }"
  136. table-layout="fixed"
  137. >
  138. <el-table-column type="index" />
  139. <el-table-column
  140. align="center"
  141. prop="invoiceNo"
  142. show-overflow-tooltip="true"
  143. label="发票号码"
  144. />
  145. <el-table-column
  146. align="center"
  147. prop="invoiceDate"
  148. show-overflow-tooltip="true"
  149. :formatter="dateFormatter"
  150. label="开票日期"
  151. />
  152. <el-table-column
  153. show-overflow-tooltip="true"
  154. align="center"
  155. prop="contractNumber"
  156. label="合同编号"
  157. />
  158. <el-table-column
  159. align="center"
  160. show-overflow-tooltip="true"
  161. prop="name"
  162. label="合同名称"
  163. />
  164. <el-table-column
  165. align="center"
  166. show-overflow-tooltip="true"
  167. prop="xmbh"
  168. label="项目编号"
  169. />
  170. <el-table-column
  171. show-overflow-tooltip="true"
  172. align="center"
  173. prop="xmmc"
  174. label="项目名称"
  175. />
  176. <el-table-column
  177. show-overflow-tooltip="true"
  178. align="center"
  179. prop="payCompany"
  180. label="付款单位"
  181. />
  182. <el-table-column
  183. align="center"
  184. show-overflow-tooltip="true"
  185. prop="invoiceContent"
  186. label="开票内容"
  187. />
  188. <el-table-column
  189. align="center"
  190. show-overflow-tooltip="true"
  191. prop="invoiceAmount"
  192. label="开票金额(元)"
  193. />
  194. <el-table-column
  195. align="center"
  196. show-overflow-tooltip="true"
  197. prop="invoiceAmount"
  198. label="未回款金额(元)"
  199. />
  200. <el-table-column
  201. align="center"
  202. show-overflow-tooltip="true"
  203. prop="returnDate"
  204. label="回款日期"
  205. />
  206. <el-table-column prop="state" label="开票状态" width="100">
  207. <template #default="scope">
  208. {{ xmztMap[scope.row.flowStatus] }}
  209. </template>
  210. </el-table-column>
  211. <el-table-column align="center" label="操作" width="80">
  212. <template #default="scope">
  213. <div class="operateBtn" @click="operateClick(scope.row)">
  214. <span>查看</span>
  215. </div>
  216. </template>
  217. </el-table-column>
  218. </el-table>
  219. </div>
  220. <div class="pageBox">
  221. <el-pagination
  222. v-model:current-page="queryParams.pageNo"
  223. :page-size="10"
  224. background
  225. layout="total, prev, pager, next, jumper"
  226. :total="total"
  227. @current-change="handleCurrentChange"
  228. />
  229. </div>
  230. </div>
  231. </div>
  232. </template>
  233. <script setup lang="ts">
  234. import * as kpglApi from '@/api/oa/kpgl'
  235. import { dateFormatter } from '@/utils/formatTime'
  236. import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
  237. import { UserFilled } from 'node_modules/_@element-plus_icons-vue@2.3.1@@element-plus/icons-vue/dist/types'
  238. defineOptions({ name: 'CommonCost' })
  239. const { wsCache } = useCache()
  240. const user = wsCache.get(CACHE_KEY.USER)
  241. const userId = user.user.id ? user.user.id : ''
  242. const xmztMap: any = {
  243. 0: '开票中',
  244. 1: '回款完成',
  245. 2: '已开票',
  246. 3: '票已送达',
  247. 4: '部分回款',
  248. 20: '开票申请完成'
  249. }
  250. const queryParams = reactive({
  251. pageNo: 1,
  252. pageSize: 10,
  253. commonCostNo: undefined,
  254. managerId: userId,
  255. applyTime: [],
  256. projectDeptId: undefined,
  257. costType: undefined,
  258. status: undefined,
  259. totalAmount: undefined
  260. })
  261. const infoList: any = ref([
  262. {
  263. name: '已开票总金额(万元)',
  264. num: 0
  265. },
  266. {
  267. name: '已回款总金额(万元)',
  268. num: 0
  269. },
  270. {
  271. name: '未回款总金额(万元)',
  272. num: 0
  273. }
  274. ])
  275. const loading = ref(true) // 列表的加载中
  276. const total = ref(0) // 列表的总页数
  277. const list = ref([]) // 列表的数
  278. /** 查询列表 */
  279. const getList = async () => {
  280. loading.value = true
  281. try {
  282. const data = await kpglApi.getCommonCostPage(queryParams)
  283. list.value = data.records
  284. total.value = data.total
  285. } finally {
  286. loading.value = false
  287. }
  288. }
  289. //统计信息
  290. const getStatics = async () => {
  291. loading.value = true
  292. const data = await kpglApi.getStatics(queryParams)
  293. infoList.value[0].num = data.ykp
  294. infoList.value[1].num = data.yhk
  295. infoList.value[2].num = (data.ykp - data.yhk).toFixed(6)
  296. }
  297. const handleCurrentChange = (pageNo: number) => {
  298. queryParams.pageNo = pageNo
  299. getList()
  300. }
  301. /** 搜索按钮操作 */
  302. const handleQuery = () => {
  303. queryParams.pageNo = 1
  304. getList()
  305. getStatics()
  306. }
  307. /** 初始化 */
  308. onMounted(() => {
  309. getList()
  310. getStatics()
  311. })
  312. </script>
  313. <style lang="scss" scoped>
  314. @import url(./ptbxBook.scss);
  315. </style>