|
@@ -0,0 +1,133 @@
|
|
|
+<template>
|
|
|
+ <div class="_ptbxBook">
|
|
|
+ <div class="searchBox">
|
|
|
+ <div class="form">
|
|
|
+ <span class="formSpan">资产名称:</span>
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.assetName"
|
|
|
+ placeholder="请输入资产名称"
|
|
|
+ style="width: 210px"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="form">
|
|
|
+ <span class="formSpan">状态:</span>
|
|
|
+ <el-select v-model="queryParams.state">
|
|
|
+ <el-option label="全部" value="" />
|
|
|
+ <el-option label="报废" value="0" />
|
|
|
+ <el-option label="正常" value="1" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="from">
|
|
|
+ <div class="btnBox">
|
|
|
+ <el-button type="primary" style="background: #3485ff" @click="handleQuery">
|
|
|
+ <img src="@/assets/imgs/OA/search.png" class="mr-8px" alt="" />
|
|
|
+ 查询</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="tableBox">
|
|
|
+ <div class="table" ref="tableRef">
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="list"
|
|
|
+ style="width: 100%; height: 100%"
|
|
|
+ :style="{ height: tableHeight + 'px' }"
|
|
|
+ :header-cell-style="{
|
|
|
+ background: '#F7F8FA',
|
|
|
+ color: '#121518',
|
|
|
+ height: '50px'
|
|
|
+ }"
|
|
|
+ table-layout="fixed"
|
|
|
+ >
|
|
|
+ <el-table-column type="index" />
|
|
|
+ <el-table-column show-overflow-tooltip="true" prop="assetNo" label="资产编号" />
|
|
|
+ <el-table-column show-overflow-tooltip="true" prop="assetName" label="资产名称" />
|
|
|
+ <el-table-column show-overflow-tooltip="true" prop="assetType" label="资产类型" />
|
|
|
+ <el-table-column show-overflow-tooltip="true" prop="assetModel" label="资产型号" />
|
|
|
+ <el-table-column show-overflow-tooltip="true" prop="amount" label="金额(元)" />
|
|
|
+ <el-table-column show-overflow-tooltip="true" prop="assetConfig" label="资产配置" />
|
|
|
+ <el-table-column prop="state" label="状态" width="60">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ xmztMap[scope.row.state] }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="操作" width="80">
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="operateBtn" @click="operateClick(scope.row)">
|
|
|
+ <span>查看</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="pageBox">
|
|
|
+ <el-pagination
|
|
|
+ v-model:current-page="queryParams.pageNo"
|
|
|
+ :page-size="10"
|
|
|
+ background
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import * as CommonCostApi from '@/api/oa/commonCost'
|
|
|
+import { dateFormatter2 } from '@/utils/formatTime'
|
|
|
+import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
|
|
+import request from '@/config/axios'
|
|
|
+defineOptions({ name: 'CommonCostDept' })
|
|
|
+const xmztMap: any = { 0: '报废', 1: '正常' }
|
|
|
+const { wsCache } = useCache()
|
|
|
+const user = wsCache.get(CACHE_KEY.USER)
|
|
|
+const userId = user.user.id ? user.user.id : ''
|
|
|
+const queryParams = reactive({
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ assetName: undefined,
|
|
|
+ userId: userId,
|
|
|
+ applyTime: [],
|
|
|
+ state: undefined,
|
|
|
+ totalAmount: undefined
|
|
|
+})
|
|
|
+const loading = ref(true) // 列表的加载中
|
|
|
+const total = ref(0) // 列表的总页数
|
|
|
+const list = ref([]) // 列表的数
|
|
|
+
|
|
|
+/** 查询列表 */
|
|
|
+const getList = async () => {
|
|
|
+ loading.value = true
|
|
|
+ try {
|
|
|
+ const urlApi = `/assetProcure/page`
|
|
|
+ const result = await request.get({ url: urlApi, params: queryParams }, '/business')
|
|
|
+ list.value = result['records']
|
|
|
+ total.value = result['total']
|
|
|
+ } finally {
|
|
|
+ loading.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+/** 搜索按钮操作 */
|
|
|
+const handleQuery = () => {
|
|
|
+ queryParams.pageNo = 1
|
|
|
+ getList()
|
|
|
+}
|
|
|
+
|
|
|
+/** 分页操作 */
|
|
|
+const handleCurrentChange = (pageNo: number) => {
|
|
|
+ queryParams.pageNo = pageNo
|
|
|
+ getList()
|
|
|
+}
|
|
|
+
|
|
|
+/** 初始化 */
|
|
|
+onMounted(() => {
|
|
|
+ getList()
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import url(./book.scss);
|
|
|
+</style>
|