You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

248 lines
8.0 KiB

<template>
<div class="app-container">
<div v-show="viewState == 1">
<div class="tab-header webtop">
<div>盖章申请管理</div>
<div>
<el-button type="primary" size="small" @click="handleCreate()">新增</el-button>
<el-button type="danger" size="small" @click="handleDelete()">删除</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<div class="webcon">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
<div v-show="isSearchShow" class="search">
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header">
<el-row>
<el-form-item label="文件名称:" class="searchlist">
<el-input v-model="listQuery.params.fileNameOrSealReason" placeholder="" clearable style="width: 150px"/>
</el-form-item>
<el-form-item label="盖章日期:" class="searchlist">
<el-date-picker value-format="yyyy-MM-dd" v-model="listQuery.params.sealStartDate" clearable style="width: 160px" type="date" placeholder="开始日期"/>
<div class="line">至</div>
<el-date-picker value-format="yyyy-MM-dd" v-model="listQuery.params.sealEndDate" clearable style="width: 160px" type="date" placeholder="结束日期"/>
</el-form-item>
</el-row>
<div class="searchbtns">
<el-button type="primary" @click="handleFilter">查询</el-button>
<el-button type="primary" @click="handReset">重置</el-button>
</div>
</el-form>
</div>
</div>
<div>
<div class="listtop">
<div class="tit">盖章申请列表</div>
<pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
<div class="">
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="50"/>
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="handUpdate(scope.row)">办理</el-button>
<el-button type="primary" size="small" @click="handLook(scope.row)">查看</el-button>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span>{{ scope.row.applyName }}</span>
</template>
</el-table-column>
<el-table-column label="申请人" align="center">
<template slot-scope="scope">
<span>{{ scope.row.applyName }}</span>
</template>
</el-table-column>
<el-table-column label="盖章日期" align="center">
<template slot-scope="scope">
<span>{{ scope.row.sealDate }}</span>
</template>
</el-table-column>
<el-table-column label="盖章类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.sealTypeValue }}</span>
</template>
</el-table-column>
<el-table-column label="文件名称" align="center">
<template slot-scope="scope">
<span>{{ scope.row.fileNameOrSealReason }}</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>
</div>
</div>
</div>
</div>
<gaizhangAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState"/>
<gaizhangInfo v-show="viewState == 4" ref="divInfo" @doback="resetState"/>
</div>
</template>
<script>
import { listPage, delBySids } from '@/api/sealContract/sealContract.js'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import gaizhangAdd from './gaizhangAdd.vue'
import gaizhangInfo from './gaizhangInfo.vue'
export default {
name: 'gaizhangguanli',
components: {
Pagination,
pageye,
gaizhangAdd,
gaizhangInfo
},
data() {
return {
isSearchShow: false,
searchxianshitit: '隐藏查询条件',
viewState: 1,
tableKey: 0,
list: [],
sids: [],
listLoading: false,
listQuery: {
current: 1,
size: 10,
params: {
fileNameOrSealReason: '',
sealStartDate: '',
sealEndDate: '',
userSid: window.sessionStorage.getItem('staffSid')
},
total: 0
}
}
},
created() {
this.getList()
},
methods: {
// 搜索条件效果
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
// 序号
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
var pageindex = index + 1 + pagestart
return pageindex
},
// 勾选
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push(element.sid)
})
this.sids = aa
console.log('勾选记录', this.sids)
},
// 查询列表信息
getList() {
this.listLoading = true
listPage(this.listQuery).then((response) => {
this.listLoading = false
if (response.code === '200') {
this.listQuery.total = response.data.total
this.list = response.data.records
}
})
},
// 查询按钮
handleFilter() {
this.getList()
},
handReset() {
this.listQuery = {
current: 1,
size: 10,
params: {
fileNameOrSealReason: '',
sealStartDate: '',
sealEndDate: '',
userSid: window.sessionStorage.getItem('staffSid')
},
total: 0
}
this.getList()
},
handleCreate() {
this.viewState = 2
this.$refs['divAdd'].showAdd()
},
handUpdate(row) {
this.viewState = 3
this.$refs['divAdd'].showEdit(row)
},
handlook(row) {
this.viewState = 4
this.$refs['divInfo'].showInfo(row)
},
handleDelete() {
if (this.sids.length) {
delBySids(this.sids).then((response) => {
if (response.code === '200') {
this.$notify({
title: '提示',
message: '删除成功',
type: 'success',
duration: 2000
})
this.getList()
} else {
this.$notify({
title: '删除失败',
message: response.msg,
type: 'error'
})
}
})
} else {
this.$notify({
title: '提示',
message: '没有选择信息!',
type: 'error',
duration: 2000
})
return
}
},
resetState() {
this.viewState = 1
this.handReset()
}
}
}
</script>
<style scoped>
.listtop {
display: flex;
justify-content: space-between;
align-items: center;
border: 1px solid #dfe4ed;
height: 40px;
}
.tit {
margin-bottom: -10px;
}
.pagination {
margin-bottom: -10px;
}
.line {
display: inline-block;
margin: 0px 15px;
}
</style>