Переглянути джерело

固定资产前端代码上传

yewc 1 рік тому
батько
коміт
5b38103a9e

+ 10 - 0
client/src/api/system/asset/index.ts

@@ -0,0 +1,10 @@
+import request from '@/config/axios'
+
+// // 查询列表
+// export const getAssetPage = async (params: PageParam) => {
+//   return await request.post({ url: '/business/AssetProcureDetail/page', params })
+// }
+// 新增部门
+export const getAssetPage = async (data:any) => {
+  return await request.post({ url: '/business/AssetProcureDetail/page', data: data })
+}

+ 279 - 0
client/src/views/OaSystem/officeCenter/gdzccgsqPage/index.vue

@@ -0,0 +1,279 @@
+<template>
+  <div class="purchaseContractBox">
+    <div class="searchBox">
+      <div class="form">
+        <span class="formSpan">状态:</span>
+        <el-select
+          width="160px"
+          v-model="qrs.state"
+          class="m-2"
+          placeholder="请选择状态"
+          size="large"
+        >
+          <el-option
+            v-for="item in stateList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </div>
+      <div class="form">
+        <span class="formSpan">申请人:</span>
+        <el-input v-model="qrs.userId" placeholder="请输入申请人" style="width: 160px" />
+      </div>
+      <div class="form">
+        <span class="formSpan">项目部门:</span>
+        <div style="width: 160px">
+          <el-tree-select
+            v-model="qrs.projectDept"
+            :data="deptList"
+            :props="defaultProps"
+            check-strictly
+            default-expand-all
+            node-key="id"
+            placeholder="请选择部门"
+          />
+        </div>
+      </div>
+      <div class="form">
+        <span class="formSpan">资产编号:</span>
+        <el-input v-model="qrs.assetNo" placeholder="请输入资产编号" style="width: 160px" />
+      </div>
+      <div class="form">
+        <span class="formSpan">资产名称:</span>
+        <el-input v-model="qrs.assetName" placeholder="请输入资产名称" style="width: 160px" />
+      </div>
+      <div class="form">
+        <span class="formSpan">资产类型:</span>
+        <el-select
+          width="160px"
+          v-model="qrs.assetType"
+          class="m-2"
+          placeholder="请选择资产类型"
+          size="large"
+        >
+          <el-option
+            v-for="item in typeList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </div>
+      <div class="form">
+        <span class="formSpan">资产型号:</span>
+        <el-input v-model="qrs.assetModel" placeholder="请输入资产型号" style="width: 160px" />
+      </div>
+      <div class="form">
+        <span class="formSpan">保管人:</span>
+        <el-input v-model="qrs.custodian" placeholder="请输入保管人" style="width: 160px" />
+      </div>
+      <div class="form">
+        <span class="formSpan">保管人部门:</span>
+        <div style="width: 160px">
+          <el-tree-select
+            v-model="qrs.custodianDept"
+            :data="deptList"
+            :props="defaultProps"
+            check-strictly
+            default-expand-all
+            node-key="id"
+            placeholder="请选择部门"
+          />
+        </div>
+      </div>
+      <div class="from">
+        <div class="btnBox">
+          <el-button type="primary" style="background: #3485ff" @click="searchHandle">
+            <img src="@/assets/imgs/OA/search.png" class="mr-8px" alt="" />
+            查询</el-button
+          >
+          <el-button type="primary">
+            <img src="@/assets/imgs/OA/open.png" class="mr-8px" alt="" />
+            导出</el-button
+          >
+        </div>
+      </div>
+    </div>
+    <div class="tableBox">
+      <div class="table" ref="tableRef">
+        <el-table
+          :data="tableData"
+          style="width: 100%; height: 100%"
+          :style="{ height: tableHeight + 'px' }"
+          :header-cell-style="{
+            background: '#F7F8FA',
+            color: '#121518',
+            height: '50px'
+          }"
+        >
+          <el-table-column label="序号" width="60">
+            <template #default="scope">{{ scope.$index + 1 }}</template>
+          </el-table-column>
+          <el-table-column prop="state" label="状态" width="320" />
+          <el-table-column prop="userNickname" label="申请人" width="180" />
+          <el-table-column prop="projectName" label="项目名称" width="100" />
+          <el-table-column prop="projectNo" label="项目编号" width="120" />
+          <el-table-column prop="projectDept" label="项目部门" />
+          <el-table-column prop="procureTime" label="采购时间" />
+          <el-table-column prop="assetNo" label="资产编号" />
+          <el-table-column prop="assetName" label="资产名称" />
+          <el-table-column prop="assetType" label="资产类型" />
+          <el-table-column prop="assetModel" label="资产型号" />
+          <el-table-column prop="custodian" label="保管人" />
+          <el-table-column prop="custodianDeptName" label="保管人部门" />
+          <el-table-column prop="amount" label="金额" />
+          <el-table-column prop="parentDevice" label="父设备" />
+          <el-table-column prop="assetSequence" label="资产序列号" />
+          <el-table-column prop="assetConfig" label="资产配置" />
+          <el-table-column prop="xmzt" label="备注" />
+
+          <el-table-column 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="qrs.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 moment from 'moment'
+import { useRouter } from 'vue-router'
+import request from '@/config/axios'
+import { getAssetURL } from '@/utils/auth'
+import { industryListAll } from '@/utils/business'
+import * as DeptApi from '@/api/system/dept'
+import * as AssetApi from '@/api/system/asset'
+import { defaultProps, handleTree } from '@/utils/tree'
+import { arrFlatten } from '../../attendanceCenter/attendAuth'
+
+defineOptions({ name: 'ProjectBook' })
+const xmztMap: any = { 0: '立项申请中', 1: '进行中', 2: '已结项', 3: '中止' }
+const router = useRouter()
+const tableRef: any = ref(null)
+const tableHeight: any = ref(0)
+
+const qrs: any = ref({
+  state: '',
+  projectDept: '',
+  userId: '',
+  procureNo: '',
+  assetNo: '',
+  assetName: '',
+  assetType: '',
+  pageNo: 1,
+  pageSize: 10,
+  custodianDept: '',
+  custodian: '',
+  assetModel: ''
+})
+const deptList = ref<Tree[]>([]) // 树形结构
+const deptSort: any = ref([])
+const initTreeDeps = async () => {
+  DeptApi.getSimpleDeptList().then((res) => {
+    deptList.value = handleTree(res)
+    deptSort.value = arrFlatten(res, 'children')
+  })
+}
+const stateList: any = ref([
+  {
+    label: '全部',
+    value: ''
+  },
+  {
+    label: '正常',
+    value: 1
+  },
+  {
+    label: '报废',
+    value: 0
+  }
+])
+const typeList: any = ref([
+  {
+    label: '计算机设备',
+    value: '计算机设备'
+  },
+  {
+    label: '机器设备',
+    value: '机器设备'
+  },
+  {
+    label: '办公家具',
+    value: '办公家具'
+  },
+  {
+    label: '行政办公设备',
+    value: '行政办公设备'
+  }
+])
+const handleCurrentChange = (pageNo: number) => {
+  qrs.pageNo = pageNo
+  queryProjectListAjax()
+}
+const operateClick = (row: any) => {
+  router.push({
+    path: '/projectDetail',
+    query: { id: row.id }
+  })
+}
+const tableData = ref<Array<any>>([])
+const total = ref<number>()
+const searchHandle: () => void = () => {
+  queryProjectListAjax()
+}
+// const queryProjectListAjax = async () => {
+//   let q = JSON.parse(JSON.stringify(qrs.value))
+//   console.log(q)
+
+//   // AssetApi.getAssetPage(q).then((result) => {
+//   //   tableData.value = result['rows']
+//   //   total.value = result['records']
+//   // })
+// }
+const queryProjectListAjax = async () => {
+  let q = JSON.parse(JSON.stringify(qrs.value))
+  AssetApi.getAssetPage(q).then((result) => {
+    tableData.value = result['rows']
+    total.value = result['records']
+  })
+}
+
+queryProjectListAjax()
+
+/**
+ * 获取行政区tree结构数据
+ */
+const areaTree = ref<Array<any>>()
+const filterNodeMethod = (value, data) => {
+  return data.name.includes(value)
+}
+const queryAreaTreeAjax = async (): Promise<void> => {
+  const urlApi = `/system/area/tree`
+  const result = await request.get({ url: urlApi })
+  areaTree.value = result
+}
+queryAreaTreeAjax()
+onMounted(() => {
+  initTreeDeps()
+  tableHeight.value = tableRef.value.clientHeight
+})
+</script>
+<style lang="scss" scoped>
+@import url(./page.scss);
+</style>

+ 98 - 0
client/src/views/OaSystem/officeCenter/gdzccgsqPage/page.scss

@@ -0,0 +1,98 @@
+.purchaseContractBox {
+  width: calc(100% - 30px);
+  height: calc(100% - 30px);
+  background: #FFFFFF;
+  border-radius: 4px 4px 4px 4px;
+  border: 1px solid #DEE0E3;
+  margin: 15px;
+
+  .searchBox {
+    width: 100%;
+    height: 125px;
+    background: #F7F8FA;
+    border-radius: 4px 4px 0 0;
+    display: flex;
+    align-items: center;
+    flex-wrap: wrap;
+    padding: 0 20px;
+    box-sizing: border-box;
+
+    .form {
+      display: flex;
+      align-items: center;
+      margin-right: 20px;
+
+      .formSpan {
+        font-size: 16px;
+      }
+
+      .btnBox {
+        display: flex;
+        align-items: center;
+      }
+    }
+  }
+
+  .infoBox {
+    width: 100%;
+    height: 55px;
+    background: #EDF2FB;
+
+    ul {
+      width: 100%;
+      height: 100%;
+      display: flex;
+      align-items: center;
+      padding: 0 20px;
+
+      li {
+        list-style: none;
+        display: flex;
+        align-items: center;
+      }
+    }
+  }
+
+  .tableBox {
+    width: 100%;
+    height: calc(100% - 180px);
+    padding: 15px 20px;
+    position: relative;
+
+    .table {
+      width: 100%;
+      height: calc(100% - 40px);
+
+      .operateBtn {
+        width: 54px;
+        height: 24px;
+        background: #EBF2FF;
+        border-radius: 16px 16px 16px 16px;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        cursor: pointer;
+
+        span {
+          color: #2E77E6;
+        }
+      }
+    }
+
+    .pageBox {
+      position: absolute;
+      right: 20px;
+      bottom: 10px;
+      text-align: right;
+    }
+  }
+  :deep(.el-radio__label),
+  :deep(.el-checkbox__label){
+      font-size: 16px;
+  }
+  :deep(.el-radio-group){
+    label {
+      margin-right: 10px;
+    }
+  }
+}