|
|
@@ -1,30 +1,147 @@
|
|
|
<!-- -->
|
|
|
<template>
|
|
|
- <div class="collect0">
|
|
|
+ <div class="holding3">
|
|
|
<TabList/>
|
|
|
<div class="right">
|
|
|
<div class="top">
|
|
|
<el-breadcrumb separator="/">
|
|
|
<el-breadcrumb-item to="">首页</el-breadcrumb-item>
|
|
|
<el-breadcrumb-item to="">征集品管理</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item id="mytitle">征集品总账</el-breadcrumb-item>
|
|
|
+ <el-breadcrumb-item id="mytitle">征集品总帐</el-breadcrumb-item>
|
|
|
</el-breadcrumb>
|
|
|
</div>
|
|
|
- <div class="conten"></div>
|
|
|
+ <div class="conten">
|
|
|
+ <div class="middle">
|
|
|
+ <div class="select">
|
|
|
+ <span>藏品类型:</span>
|
|
|
+ <el-select v-model="mydata.goodsTypeId" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in mytype"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <span v-if="0">藏品年代:</span>
|
|
|
+ <el-select v-if="0" v-model="age" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in source2"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <span>藏品名称:</span>
|
|
|
+ <el-input
|
|
|
+ v-model="mydata.searchKey"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width: 217px"
|
|
|
+ ></el-input>
|
|
|
+ <el-button style="margin-left: 20px" @click="inquire">查询</el-button>
|
|
|
+ <el-button v-if="0">导出</el-button>
|
|
|
+ <div class="pattern">
|
|
|
+ <div :class="{ active: change === 0 }" @click="pattern(0)">
|
|
|
+ <i class="el-icon-menu"></i>
|
|
|
+ </div>
|
|
|
+ <div :class="{ active: change === 1 }" @click="pattern(1)">
|
|
|
+ <i class="el-icon-s-unfold"></i>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--表格 -->
|
|
|
+ <div class="table" v-if="change">
|
|
|
+ <el-table
|
|
|
+ :header-cell-style="{ background: '#eef1f6', color: '#606266' }"
|
|
|
+ :data="tableData"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column label="缩略图" width="80">
|
|
|
+ <template #default='{row}'>
|
|
|
+ <div class="smimg">
|
|
|
+ <img :src="baseURL+row.thumb" alt="" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="registerNum"
|
|
|
+ sortable
|
|
|
+ label="总登记号"
|
|
|
+ width="235"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="name" sortable label="藏品名称">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="age" sortable label="年代" width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="textureType" sortable label="质地" width="220">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="status" label="状态" width="130">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="130">
|
|
|
+ <template #default="{row}">
|
|
|
+ <el-button type="text" @click="myLook(row)">查看</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <!-- 图片显示 -->
|
|
|
+ <div class="imgInfo" v-else>
|
|
|
+ <div class="beNull" v-if="imgList.length===0">暂无数据</div>
|
|
|
+ <div v-else class="imgInfo_single" v-for="(item,index) in imgList" :key="index" @click="myLook(item)">
|
|
|
+ <img :src="baseURL+item.thumb" alt="" />
|
|
|
+ <span>{{item.name}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 分页器 -->
|
|
|
+ <div class="paging">
|
|
|
+ <el-pagination
|
|
|
+ :current-page='mydata.pageNum'
|
|
|
+ @current-change='currentChange'
|
|
|
+ @size-change='sizeChange'
|
|
|
+ background
|
|
|
+ layout="prev, pager, next,sizes,jumper"
|
|
|
+ :total="total"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
<script>
|
|
|
+import axios from '@/utils/request'
|
|
|
+import { getHolding3List } from '@/apis/collect0'
|
|
|
+import { getGoodsType } from '@/apis/holding'
|
|
|
import TabList from '@/components/tabLeft2.vue'
|
|
|
export default {
|
|
|
- name: 'collect0',
|
|
|
- // import引入的组件需要注入到对象中才能使用
|
|
|
+ name: 'Collect0',
|
|
|
components: { TabList },
|
|
|
data () {
|
|
|
- // 这里存放数据
|
|
|
return {
|
|
|
-
|
|
|
+ // 分页器数据总条数
|
|
|
+ total: 0,
|
|
|
+ // 服务器前缀地址
|
|
|
+ baseURL: '',
|
|
|
+ // 请求藏品总账参数
|
|
|
+ mydata: {
|
|
|
+ goodsTypeId: '', // 藏品类型id
|
|
|
+ pageNum: 1, // 起始页码,默认1为第一页
|
|
|
+ pageSize: 10, // 每页数量
|
|
|
+ searchKey: '' // 搜索条件
|
|
|
+ },
|
|
|
+ // 控制显示表格还是图片
|
|
|
+ change: 0,
|
|
|
+ age: '',
|
|
|
+ source2: [],
|
|
|
+ // 图片数据
|
|
|
+ imgList: [],
|
|
|
+ // 表格数据
|
|
|
+ tableData: [],
|
|
|
+ mytype: []
|
|
|
}
|
|
|
},
|
|
|
// 监听属性 类似于data概念
|
|
|
@@ -33,12 +150,68 @@ export default {
|
|
|
watch: {},
|
|
|
// 方法集合
|
|
|
methods: {
|
|
|
-
|
|
|
+ // 点击查询
|
|
|
+ inquire () {
|
|
|
+ this.mydata.pageNum = 1
|
|
|
+ this.getHolding3List(this.mydata)
|
|
|
+ },
|
|
|
+ // 分页器
|
|
|
+ currentChange (val) {
|
|
|
+ // console.log('当前页改变了', val)
|
|
|
+ this.mydata.pageNum = val
|
|
|
+ this.getHolding3List(this.mydata)
|
|
|
+ },
|
|
|
+ sizeChange (val) {
|
|
|
+ // console.log('条数改变了', val)
|
|
|
+ this.mydata.pageSize = val
|
|
|
+ this.getHolding3List(this.mydata)
|
|
|
+ },
|
|
|
+ // 点击查看
|
|
|
+ myLook (val) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/layout/collect0_look',
|
|
|
+ query: val
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 封装获取藏品总账列表
|
|
|
+ async getHolding3List (data) {
|
|
|
+ const res = await getHolding3List(data)
|
|
|
+ this.total = res.data.total
|
|
|
+ // console.log(666, res)
|
|
|
+ this.imgList = res.data.list
|
|
|
+ this.tableData = res.data.list
|
|
|
+ this.tableData.forEach(v => {
|
|
|
+ if (v.textureType === 0) v.textureType = '单一质地'
|
|
|
+ else v.textureType = '复合质地'
|
|
|
+ if (v.status === 0) v.status = '待入库'
|
|
|
+ else if (v.status === 1) v.status = '已入库'
|
|
|
+ else v.status = '已出库'
|
|
|
+ v.numTypeId = this.mycategory(v.numTypeId)
|
|
|
+ v.integrity = this.spoil(v.integrity)
|
|
|
+ v.repair = this.mySave(v.repair)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 控制显示表格还是图片
|
|
|
+ pattern (index) {
|
|
|
+ this.change = index
|
|
|
+ }
|
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created () {},
|
|
|
+ async created () {
|
|
|
+ // 获取藏品类型
|
|
|
+ const res = await getGoodsType()
|
|
|
+ this.mytype = res.data
|
|
|
+ this.mytype.unshift({ id: '', name: '全部' })
|
|
|
+ // 获取服务器前缀地址
|
|
|
+ this.baseURL = axios.defaults.baseURL
|
|
|
+ },
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
- mounted () {},
|
|
|
+ mounted () {
|
|
|
+ // 调用获取藏品总账列表
|
|
|
+ this.getHolding3List(this.mydata)
|
|
|
+ // 显示图还是表格
|
|
|
+ this.tabInd = this.INtabInd
|
|
|
+ },
|
|
|
beforeCreate () {}, // 生命周期 - 创建之前
|
|
|
beforeMount () {}, // 生命周期 - 挂载之前
|
|
|
beforeUpdate () {}, // 生命周期 - 更新之前
|
|
|
@@ -49,16 +222,14 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style lang='less' scoped>
|
|
|
-//@import url(); 引入公共css类
|
|
|
-.collect0 {
|
|
|
+.holding3 {
|
|
|
/deep/#mytitle>span{
|
|
|
font-weight: 800;
|
|
|
}
|
|
|
+
|
|
|
display: flex;
|
|
|
.right {
|
|
|
width: 100%;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
.top {
|
|
|
padding-left: 35px;
|
|
|
display: flex;
|
|
|
@@ -68,11 +239,102 @@ export default {
|
|
|
height: 40px;
|
|
|
background-color: #fff;
|
|
|
}
|
|
|
- }
|
|
|
- .conten {
|
|
|
- flex: 1;
|
|
|
- background-color: #fff;
|
|
|
- margin: 20px 20px 40px;
|
|
|
+ .conten {
|
|
|
+ padding: 20px 20px 40px;
|
|
|
+ width: 100%;
|
|
|
+ height: 829px;
|
|
|
+ .middle {
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background-color: #fff;
|
|
|
+ .select {
|
|
|
+ align-items: center;
|
|
|
+ display: flex;
|
|
|
+ .pattern {
|
|
|
+ display: flex;
|
|
|
+ margin-left: 22px;
|
|
|
+ width: 130px;
|
|
|
+ height: 40px;
|
|
|
+ .active {
|
|
|
+ background-color: #3aa1ed;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ div {
|
|
|
+ cursor: pointer;
|
|
|
+ width: 65px;
|
|
|
+ height: 40px;
|
|
|
+ border-radius: 12px;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ color: #666;
|
|
|
+ i {
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ color: black;
|
|
|
+ padding: 30px 0 0 0;
|
|
|
+ & > span {
|
|
|
+ margin-left: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .table {
|
|
|
+ max-height: 640px;
|
|
|
+ overflow: auto;
|
|
|
+ padding: 24px;
|
|
|
+ .smimg {
|
|
|
+ // width: 80px;
|
|
|
+ // height: 60px;
|
|
|
+ img {
|
|
|
+ margin: 5px 0 0 5px;
|
|
|
+ width: 50px;
|
|
|
+ // height: 50px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .imgInfo {
|
|
|
+ .beNull{
|
|
|
+ margin-top: 40px;
|
|
|
+ font-size: 26px;
|
|
|
+ }
|
|
|
+ max-height: 635px;
|
|
|
+ overflow: auto;
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ padding: 10px 60px 40px 60px;
|
|
|
+ .imgInfo_single {
|
|
|
+
|
|
|
+ cursor: pointer;
|
|
|
+ margin: 30px 45px 0 45px;
|
|
|
+ text-align: center;
|
|
|
+ width: 215px;
|
|
|
+ height: 250px;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ img {
|
|
|
+ // object-fit:scale-down;
|
|
|
+ width: 215px;
|
|
|
+ height: 200px;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ border: 5px solid #ccc;
|
|
|
+ }
|
|
|
+ span {
|
|
|
+ color: black;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .paging {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 15px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|