Browse Source

完善维修出入库查询

master
yunuo970428 2 months ago
parent
commit
a4e088d442
  1. 430
      yxt-as-ui/src/views/storage/maintenanceInOrOutBound/index.vue

430
yxt-as-ui/src/views/storage/maintenanceInOrOutBound/index.vue

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="维修领/退料查询" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<button-bar ref="btnbar" view-title="维修领/退料查询" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
@ -10,32 +10,29 @@
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="单据编号">
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
<el-input v-model="queryParams.params.billNo" placeholder="" clearable/>
</el-form-item>
<el-form-item label="单据日期">
<el-date-picker v-model="queryParams.params.createTimestart" type="date" placeholder="选择日期"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
<el-date-picker v-model="queryParams.params.createTimestart" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
<span style="padding: 0 8px"></span>
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
</el-date-picker>
</el-form-item>
<el-form-item label="维修工单编号">
<el-input v-model="queryParams.params.sourceBillNo" placeholder="" clearable />
<el-input v-model="queryParams.params.sourceBillNo" placeholder="" clearable/>
</el-form-item>
<el-form-item label="业务类型">
<el-select v-model="queryParams.params.busTypeValue" filterable clearable placeholder="请选择"
style="width:100%">
<el-select v-model="queryParams.params.busTypeValue" filterable clearable placeholder="请选择" style="width:100%">
<el-option v-for="item in billStateList" :key="item.sid" :label="item.name" :value="item.name">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="操作人">
<el-input v-model="queryParams.params.createByName" placeholder="" clearable />
<el-input v-model="queryParams.params.createByName" placeholder="" clearable/>
</el-form-item>
<el-form-item label="经办人">
<el-input v-model="queryParams.params.warehouseManager" placeholder="" clearable />
<el-input v-model="queryParams.params.warehouseManager" placeholder="" clearable/>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
@ -44,256 +41,227 @@
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">维修领/退料列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center" />
<el-table-column fixed width="80" label="序号" type="index" :index="indexMethod" align="center" />
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" @selection-change="selectionLineChangeHandle">
<el-table-column fixed width="50" type="selection" align="center"/>
<el-table-column fixed width="80" label="序号" type="index" :index="indexMethod" align="center"/>
<el-table-column label="单据编号" align="center">
<template slot-scope="scope">
<div style="color: #1890FF; text-decoration: underline ;" @click="showResult(scope.row)">
{{ scope.row.billNo }}
</div>
<span class="bluezi" @click="showResult(scope.row)">{{ scope.row.billNo }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="单据时间" align="center" />
<el-table-column prop="sourceBillNo" label="维修工单编号" align="center" />
<el-table-column prop="busTypeValue" label="业务类型" align="center" />
<el-table-column prop="createByName" label="操作人" align="center" />
<el-table-column prop="warehouseManager" label="经办人" align="center" />
<el-table-column prop="remarks" label="备注" align="center" />
<el-table-column prop="createTime" label="单据时间" align="center"/>
<el-table-column prop="sourceBillNo" label="维修工单编号" align="center"/>
<el-table-column prop="busTypeValue" label="业务类型" align="center"/>
<el-table-column prop="createByName" label="操作人" align="center"/>
<el-table-column prop="warehouseManager" label="经办人" align="center"/>
<el-table-column prop="remarks" label="备注" align="center"/>
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<div class="tit"/>
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" :limit.sync="queryParams.size" class="pagination" @pagination="loadList"/>
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divOutInfo v-show="viewState == 2 " ref="divOutInfo" @doback="resetState" @reloadlist="loadList" />
<divReturnInfo v-show="viewState == 3" ref="divReturnInfo" @doback="resetState" @reloadlist="loadList" />
<divOutInfo v-show="viewState == 2 " ref="divOutInfo" @doback="resetState" @reloadlist="loadList"/>
<divReturnInfo v-show="viewState == 3" ref="divReturnInfo" @doback="resetState" @reloadlist="loadList"/>
</div>
</template>
<script>
import req from '@/api/storage/maintenanceInOrOutBound.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divOutInfo from './maintenanceOutboundInfo.vue'
import divReturnInfo from './maintenanceReturnBoundInfo.vue'
export default {
components: {
ButtonBar,
Pagination,
pageye,
divOutInfo,
divReturnInfo
},
data() {
return {
dialogVisible: false,
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'success',
size: 'small',
icon: 'export',
btnKey: 'toBuild',
btnLabel: '导出'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
import req from '@/api/storage/maintenanceInOrOutBound.js'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import divOutInfo from './maintenanceOutboundInfo.vue'
import divReturnInfo from './maintenanceReturnBoundInfo.vue'
export default {
components: {
ButtonBar,
Pagination,
divOutInfo,
divReturnInfo
},
data() {
return {
dialogVisible: false,
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [
{
type: 'success',
size: 'small',
icon: 'export',
btnKey: 'toBuild',
btnLabel: '导出'
},
sids: [],
selectionList: [],
billStateList: [{
name: "维修出库",
sid: "0"
},
{
name: "维修退库",
sid: "1"
}
],
}
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
},
sids: [],
selectionList: [],
billStateList: [
{
name: '维修出库',
sid: '0'
},
{
name: '维修退库',
sid: '1'
}
]
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
selectionLineChangeHandle(val) {
this.selectionList = val
const aa = []
val.forEach(element => {
aa.push(element.sid)
})
this.sids = aa
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
created() {
this.loadList()
btnHandle(btnKey) {
switch (btnKey) {
case 'doDel':
// this.doDel()
this.toRelevancy()
break
case 'toBuild':
this.toBuild()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
methods: {
selectionLineChangeHandle(val) {
console.log("val", val);
this.selectionList = val
const aa = []
val.forEach(element => {
aa.push(element.sid)
})
this.sids = aa
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'doDel':
// this.doDel()
this.toRelevancy()
break
case 'toBuild':
this.toBuild()
break
case 'doClose':
this.doClose()
break
default:
break
// resp.code
this.dataList = []
this.queryParams.total = 0
}
},
loadList() {
this.tableLoading = true
req.listPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
}).catch(() => {
this.tableLoading = false
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
name: ''
}
this.loadList()
},
toBuild() {
// if (this.sids.length > 0) {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.exportExcel(this.queryParams.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '旧件出入库记录' + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
}
this.loadList()
},
toBuild() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.exportExcel(this.queryParams.params).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
// } else {
// this.$message({
// type: "warning",
// showClose: true,
// message: ''
// })
// }
},
showResult(row) {
if (row.busTypeValue == '维修出库') {
this.viewState = 2
this.$refs['divOutInfo'].showAdd(row)
}
if (row.busTypeValue == '维修退库') {
this.viewState = 3
this.$refs['divReturnInfo'].showAdd(row)
}
},
toRelevancy() {
this.viewState = 4
this.$refs['divinfo'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
resetState() {
this.viewState = 1
},
const fileName = '维修出入库记录' + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
showResult(row) {
if (row.busTypeValue == '维修出库') {
this.viewState = 2
this.$refs['divOutInfo'].showAdd(row)
}
if (row.busTypeValue == '维修退库') {
this.viewState = 3
this.$refs['divReturnInfo'].showAdd(row)
}
},
toRelevancy() {
this.viewState = 4
this.$refs['divinfo'].showAdd()
},
doClose() {
this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1)
},
resetState() {
this.viewState = 1
}
}
}
</script>
<style scoped>
</style>

Loading…
Cancel
Save