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

Loading…
Cancel
Save