|
|
@@ -1,8 +1,7 @@
|
|
|
<!-- -->
|
|
|
<template>
|
|
|
<div class="holding">
|
|
|
-
|
|
|
-<TabList />
|
|
|
+ <TabList />
|
|
|
<div class="right">
|
|
|
<div class="top">
|
|
|
<el-breadcrumb separator="/">
|
|
|
@@ -13,6 +12,16 @@
|
|
|
</div>
|
|
|
<div class="conten">
|
|
|
<div class="middle">
|
|
|
+ <ul class="title">
|
|
|
+ <li
|
|
|
+ :class="{ active: stateInd === index }"
|
|
|
+ @click="stateSelect(index)"
|
|
|
+ v-for="(item, index) in stateArr"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ {{ item.txt }}({{ item.num }})
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
<div class="select">
|
|
|
<span>藏品来源:</span>
|
|
|
<el-select v-model="myData.sourceId" placeholder="请选择">
|
|
|
@@ -32,14 +41,17 @@
|
|
|
style="width: 217px"
|
|
|
></el-input>
|
|
|
<span>创建日期:</span>
|
|
|
- <el-date-picker
|
|
|
- v-model="time"
|
|
|
- type="daterange"
|
|
|
- range-separator="-"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期">
|
|
|
- </el-date-picker>
|
|
|
- <el-button style="margin-left: 20px" @click="inquire">查询</el-button>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="time"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ <el-button style="margin-left: 20px" @click="inquire"
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
<el-button type="primary" @click="addOne()">新增</el-button>
|
|
|
</div>
|
|
|
<!--表格 -->
|
|
|
@@ -65,11 +77,35 @@
|
|
|
<el-table-column prop="status" label="状态" width="130">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="150">
|
|
|
- <template #default='{row}'>
|
|
|
- <el-button type="text" v-if="row.status==='已完成'||row.status==='审核不通过'||row.status==='审核通过'" @click="mylook(row)">查看</el-button>
|
|
|
- <el-button type="text" v-if="row.status==='待办理'||row.status==='草稿中'||row.status==='待审核'" @click="editH0(row)">编辑</el-button>
|
|
|
- <el-button type="text" v-if="row.status==='待审核'||row.status==='草稿中'" @click="auditH0(row)">审核</el-button>
|
|
|
- <el-button type="text" @click="removeH0(row.id)" v-if="row.status!=='审核通过'">删除</el-button>
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ v-if="
|
|
|
+ row.status === '已完成' ||
|
|
|
+ row.status === '审核不通过' ||
|
|
|
+ row.status === '已完成'
|
|
|
+ "
|
|
|
+ @click="mylook(row)"
|
|
|
+ >查看</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ v-if="row.status === '待办理' || row.status === '待办理'"
|
|
|
+ @click="editH0(row)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ v-if="row.status === '待审核'"
|
|
|
+ @click="auditH0(row)"
|
|
|
+ >审核</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="removeH0(row.id)"
|
|
|
+ v-if="row.status !== '已完成'"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -77,9 +113,8 @@
|
|
|
<!-- 分页器 -->
|
|
|
<div class="paging">
|
|
|
<el-pagination
|
|
|
- @current-change='currentChange'
|
|
|
- @size-change='sizeChange'
|
|
|
- :page-sizes='[8,16,24,32]'
|
|
|
+ @current-change="currentChange"
|
|
|
+ @size-change="sizeChange"
|
|
|
background
|
|
|
layout="prev, pager, next,sizes,jumper"
|
|
|
:total="total"
|
|
|
@@ -93,7 +128,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { oneAdd, getList, getGoodsFrom, removeH0, auditH0 } from '@/apis/holding'
|
|
|
+import { oneAdd, getList, getGoodsFrom, removeH0 } from '@/apis/holding'
|
|
|
import TabList from '@/components/tabLeft.vue'
|
|
|
export default {
|
|
|
name: 'Holding0',
|
|
|
@@ -102,6 +137,15 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ // 选择状态的变量
|
|
|
+ stateInd: 0,
|
|
|
+ stateArr: [
|
|
|
+ { txt: '全部', num: 0 },
|
|
|
+ { txt: '待审核', num: 0 },
|
|
|
+ { txt: '待办理', num: 0 },
|
|
|
+ { txt: '已完成', num: 0 },
|
|
|
+ { txt: '审核不通过', num: 0 }
|
|
|
+ ],
|
|
|
// 数据总条数
|
|
|
total: 0,
|
|
|
// 获取列表数据字段
|
|
|
@@ -109,9 +153,10 @@ export default {
|
|
|
startTime: '', // 开始时间
|
|
|
endTime: '', // 结束时间
|
|
|
pageNum: 1, // 起始页码,默认1为第一页
|
|
|
- pageSize: 8, // 每页数量
|
|
|
+ pageSize: 10, // 每页数量
|
|
|
searchKey: '', // 搜索条件
|
|
|
- sourceId: null // 臧品来源Id
|
|
|
+ sourceId: null, // 臧品来源Id
|
|
|
+ status: ''
|
|
|
},
|
|
|
time: '',
|
|
|
source: [],
|
|
|
@@ -130,6 +175,34 @@ export default {
|
|
|
},
|
|
|
// 方法集合
|
|
|
methods: {
|
|
|
+ // 点击上面的状态切换
|
|
|
+ stateSelect (index) {
|
|
|
+ if (index !== this.stateInd) {
|
|
|
+ this.myData.pageNum = 1
|
|
|
+ // 点击待审核
|
|
|
+ if (index === 1) {
|
|
|
+ this.myData.status = 1
|
|
|
+ this.getList(this.myData)
|
|
|
+ } else if (index === 2) {
|
|
|
+ // 点击待办理
|
|
|
+ this.myData.status = 0
|
|
|
+ this.getList(this.myData)
|
|
|
+ } else if (index === 3) {
|
|
|
+ // 点击已完成
|
|
|
+ this.myData.status = 3
|
|
|
+ this.getList(this.myData)
|
|
|
+ } else if (index === 4) {
|
|
|
+ // 点击审核不通过
|
|
|
+ this.myData.status = 2
|
|
|
+ this.getList(this.myData)
|
|
|
+ } else if (index === 0) {
|
|
|
+ // 点击全部
|
|
|
+ this.myData.status = ''
|
|
|
+ this.getList(this.myData)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.stateInd = index
|
|
|
+ },
|
|
|
// 点击查询
|
|
|
inquire () {
|
|
|
this.myData.pageNum = 1
|
|
|
@@ -138,10 +211,29 @@ export default {
|
|
|
// 分页器
|
|
|
currentChange (val) {
|
|
|
// console.log('当前页改变了', val)
|
|
|
+ // this.myData.sourceId = null
|
|
|
+ // this.myData.searchKey = ''
|
|
|
+ // this.time = []
|
|
|
+ // this.myData.endTime = ''
|
|
|
+ // this.myData.startTime = ''
|
|
|
this.myData.pageNum = val
|
|
|
this.getList(this.myData)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 所有dom加载完毕之后---要执行的代码
|
|
|
+ setTimeout(() => {
|
|
|
+ if (this.tableData.length === 0) {
|
|
|
+ this.myData.pageNum = 1
|
|
|
+ this.getList(this.myData)
|
|
|
+ }
|
|
|
+ }, 100)
|
|
|
+ })
|
|
|
},
|
|
|
sizeChange (val) {
|
|
|
+ // this.myData.sourceId = null
|
|
|
+ // this.myData.searchKey = ''
|
|
|
+ // this.time = []
|
|
|
+ // this.myData.endTime = ''
|
|
|
+ // this.myData.startTime = ''
|
|
|
// console.log('条数改变了', val)
|
|
|
this.myData.pageSize = val
|
|
|
this.getList(this.myData)
|
|
|
@@ -162,7 +254,7 @@ export default {
|
|
|
},
|
|
|
// 点击审核
|
|
|
async auditH0 (val) {
|
|
|
- if (val.status === '草稿中') await auditH0(val.id)
|
|
|
+ // if (val.status === '草稿中') await auditH0(val.id)
|
|
|
this.$router.push({
|
|
|
path: '/layout/holding0_audit',
|
|
|
query: val
|
|
|
@@ -174,20 +266,22 @@ export default {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
- }).then(async () => {
|
|
|
- // 发请求,清空数据
|
|
|
- await removeH0(id)
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ // 发请求,清空数据
|
|
|
+ await removeH0(id)
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ })
|
|
|
+ this.getList(this.myData)
|
|
|
})
|
|
|
- this.getList(this.myData)
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消.'
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消.'
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
},
|
|
|
// 时间处理----------------
|
|
|
handleSelect (e) {
|
|
|
@@ -199,12 +293,18 @@ export default {
|
|
|
this.myData.endTime = date[1]
|
|
|
},
|
|
|
gettime (data) {
|
|
|
- const value = data.getFullYear() + '-' +
|
|
|
- this.checkTime(data.getMonth() + 1) + '-' +
|
|
|
- this.checkTime(data.getDate()) + ' ' +
|
|
|
- this.checkTime(data.getHours()) + ':' +
|
|
|
- this.checkTime(data.getMinutes()) + ':' +
|
|
|
- this.checkTime(data.getSeconds())
|
|
|
+ const value =
|
|
|
+ data.getFullYear() +
|
|
|
+ '-' +
|
|
|
+ this.checkTime(data.getMonth() + 1) +
|
|
|
+ '-' +
|
|
|
+ this.checkTime(data.getDate()) +
|
|
|
+ ' ' +
|
|
|
+ this.checkTime(data.getHours()) +
|
|
|
+ ':' +
|
|
|
+ this.checkTime(data.getMinutes()) +
|
|
|
+ ':' +
|
|
|
+ this.checkTime(data.getSeconds())
|
|
|
return value
|
|
|
},
|
|
|
checkTime (i) {
|
|
|
@@ -218,12 +318,13 @@ export default {
|
|
|
const res = await getList(data)
|
|
|
this.total = res.data.total
|
|
|
this.tableData = res.data.list
|
|
|
- this.tableData.forEach(v => {
|
|
|
+ this.tableData.forEach((v) => {
|
|
|
v.sourceId = this.mySource(v.sourceId)
|
|
|
v.status = this.myState(v.status)
|
|
|
})
|
|
|
// console.log(6666, res.data.list)
|
|
|
},
|
|
|
+
|
|
|
// 点击新增
|
|
|
async addOne () {
|
|
|
// 从主页面点击第一层新增
|
|
|
@@ -242,10 +343,28 @@ export default {
|
|
|
// 获取藏品来源
|
|
|
const res = await getGoodsFrom()
|
|
|
this.source = res.data
|
|
|
+ this.source.unshift({ id: '', name: '全部' })
|
|
|
},
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
- mounted () {
|
|
|
+ async mounted () {
|
|
|
this.tabInd = this.INtabInd
|
|
|
+ // 进页面拿到所有数据
|
|
|
+ const res = await getList({ ...this.myData, pageSize: 99999 })
|
|
|
+ this.stateArr[0].num = res.data.list.length
|
|
|
+ let num1 = 0
|
|
|
+ let num2 = 0
|
|
|
+ let num3 = 0
|
|
|
+ let num4 = 0
|
|
|
+ res.data.list.forEach(v => {
|
|
|
+ if (v.status === 1) num1++
|
|
|
+ if (v.status === 0) num2++
|
|
|
+ if (v.status === 3) num3++
|
|
|
+ if (v.status === 2) num4++
|
|
|
+ })
|
|
|
+ this.stateArr[1].num = num1
|
|
|
+ this.stateArr[2].num = num2
|
|
|
+ this.stateArr[3].num = num3
|
|
|
+ this.stateArr[4].num = num4
|
|
|
},
|
|
|
beforeCreate () {}, // 生命周期 - 创建之前
|
|
|
beforeMount () {}, // 生命周期 - 挂载之前
|
|
|
@@ -258,7 +377,7 @@ export default {
|
|
|
</script>
|
|
|
<style lang='less' scoped>
|
|
|
.holding {
|
|
|
- /deep/#mytitle>span{
|
|
|
+ /deep/#mytitle > span {
|
|
|
font-weight: 800;
|
|
|
}
|
|
|
|
|
|
@@ -280,6 +399,26 @@ export default {
|
|
|
width: 100%;
|
|
|
height: 829px;
|
|
|
.middle {
|
|
|
+ .title {
|
|
|
+ height: 60px;
|
|
|
+ border-bottom: 1px solid #ccc;
|
|
|
+ margin: 0 25px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: black;
|
|
|
+ .active {
|
|
|
+ color: #409eff;
|
|
|
+ border-bottom: 2px solid #409eff;
|
|
|
+ }
|
|
|
+ li {
|
|
|
+ height: 60px;
|
|
|
+ line-height: 60px;
|
|
|
+ padding: 0 15px;
|
|
|
+ text-align: center;
|
|
|
+ margin-left: 40px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
position: relative;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
@@ -292,9 +431,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.table {
|
|
|
- max-height: 640px;
|
|
|
- overflow: auto;
|
|
|
+ max-height: 580px;
|
|
|
+ max-width: 1710px;
|
|
|
+ // overflow: auto;
|
|
|
padding: 24px;
|
|
|
+ /deep/.el-table__body-wrapper{
|
|
|
+ max-height: 510px;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
}
|
|
|
.paging {
|
|
|
position: absolute;
|