作者 小范

出入库查询列表引用组件

... ... @@ -3,161 +3,44 @@
<el-card style="background-color: #F5F7FA">
<!-- 搜索区域-->
<el-row :gutter="10" class="toolbar">
<el-col :span="7">
<el-input v-model="queryInfo.waybill" prefix-icon="el-icon-search" size="small" style="width: 280px"
<el-col :span="5">
<el-input v-model="queryInfo.waybill" prefix-icon="el-icon-search" size="small" style="width: 240px"
placeholder="主单号" clearable>
<template slot="prepend">主单号</template>
</el-input>
</el-col>
<el-col :span="5">
<el-input v-model="queryInfo.billfhl" prefix-icon="el-icon-search" size="small" style="width: 240px"
placeholder="分单号" clearable>
<template slot="prepend">分单号</template>
</el-input>
</el-col>
<el-col :span="5">
<div class="my-text-area">
<div class="el-input-group__prepend prepand">出入库类型</div>
<el-select v-model="queryInfo.ietype" placeholder="出入库类型" size="mini" style="width: 140px">
<el-option label="出入库类型-进" value="I"></el-option>
<el-option label="出入库类型-出" value="E"></el-option>
</el-select>
</div>
<!-- <el-input v-model="queryInfo.ietype" prefix-icon="el-icon-search" size="small" style="width: 240px"-->
<!-- placeholder="类型" clearable>-->
<!-- <template slot="prepend">类型</template>-->
<!-- </el-input>-->
</el-col>
<el-col :span="5">
<el-input v-model="queryInfo.custcode" prefix-icon="el-icon-search" size="small" style="width: 240px"
placeholder="货物单号" clearable>
<template slot="prepend">货物单号</template>
<template slot="prepend">客户代码</template>
</el-input>
</el-col>
<el-col :span="6">
<el-col :span="4">
<el-button type="primary" icon="el-icon-search" size="small" @click="getList()">
查询
</el-button>
<el-button type="success" icon="el-icon-edit" size="small" @click="applyAdd()">新增</el-button>
</el-col>
</el-row>
<!-- 列表区域-->
<el-row>
<template>
<el-table
:data="tableData"
border
:cell-style="{textAlign:'center'}"
style="border-radius: 10px 10px 0px 0px;line-height: 25px"
:header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small"
>
<el-table-column
fixed
prop="waybill"
label="货物单号"
width="120">
</el-table-column>
<el-table-column
prop="vol"
label="体积"
width="60">
</el-table-column>
<el-table-column
prop="weight"
label="重量"
width="60">
</el-table-column>
<el-table-column
prop="pcs"
label="件数"
width="60">
</el-table-column>
<el-table-column
prop="billweight"
label="计费重量"
width="70">
</el-table-column>
<el-table-column
prop="area"
label="库区"
width="60">
</el-table-column>
<el-table-column
prop="location"
label="库位"
width="60">
</el-table-column>
<el-table-column
prop="serialnumber"
label="流水号"
width="120">
</el-table-column>
<el-table-column
prop="station"
label="出入库场站"
width="100">
</el-table-column>
<el-table-column
prop="status"
label="状态"
width="80">
<template slot-scope="scope">
<span v-if="scope.row.status ==='0'">失败</span>
<span v-if="scope.row.status ==='1'">成功</span>
</template>
</el-table-column>
<el-table-column
prop="transcar"
label="运输车辆信息"
width="100">
</el-table-column>
<el-table-column
prop="transtype"
label="交易类型"
width="100">
</el-table-column>
<el-table-column
prop="custel"
label="客户联系电话"
width="140">
</el-table-column>
<el-table-column
prop="customer"
label="联系人姓名"
width="100">
</el-table-column>
<el-table-column
prop="customername"
label="客户名称"
width="80">
</el-table-column>
<el-table-column
prop="goodstype"
label="货物类型"
width="80">
</el-table-column>
<el-table-column
prop="house"
label="出入库仓库"
width="100">
</el-table-column>
<el-table-column
prop="ietype"
label="类型"
width="60">
<template slot-scope="scope">
<span v-if="scope.row.ietype ==='I'">进</span>
<span v-if="scope.row.ietype ==='E'">出</span>
</template>
</el-table-column>
<el-table-column
prop="opter"
label="出入库经办人"
width="100">
</el-table-column>
<el-table-column
prop="opttime"
label="出入库时间"
width="140">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="160">
<template slot-scope="scope">
<el-button type="success" size="mini" @click="applyEdit(scope.row)">编辑</el-button>
<el-button type="danger" size="mini" @click="applyDel(scope.$index,scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-row>
<el-row style="margin-top: 10px" class="toolbar">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryInfo.pageNum"
:page-size="queryInfo.pageSize"
:page-sizes="[10, 50, 100, 500]"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</el-row>
<el-row>
<el-dialog :title="dialogMap[dialogApply]" :visible.sync="apply_dialog.addDialog" width="80%" >
<el-form :model="addForm" :rules="rules" ref="addForm" style="margin-top: 40px">
... ... @@ -356,26 +239,37 @@
</div>
</el-dialog>
</el-row>
<!-- 列表区域-->
<Tabulation
ref="tabulation"
:tabulationInfo="queryInfo"
></Tabulation>
</el-card>
</el-row>
</template>
<script>
import {selectInventroyrecords,delInventoryrecord,addInventoryrecord,ediInventroyrecord} from '../../api/consigner/station';
import {selectNewInventroyrecords,delInventoryrecord,addInventoryrecord,ediInventroyrecord} from '../../api/consigner/station';
import Tabulation from "./tabulation"
export default {
name: "inventroyrecord",
components: {
Tabulation
},
data() {
return {
queryInfo: {
waybill:'',
billfhl:'',
ietype:'',
custcode:'',
// 当前页数
pageNum: 1,
// 每页大小
pageSize: 10,
},
total: 0,
tableData:[],
// tableData:[],
dialogMap: {
update: '编辑',
create: '新增'
... ... @@ -463,31 +357,9 @@
this.zancundata.push(this.addForm);
console.log(this.zancundata)
},
handleSizeChange(val) {
this.queryInfo.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.queryInfo.pageNum = val
this.getList()
},
getList() {
const _this = this
selectInventroyrecords(this.queryInfo).then((response) => {
const res = response.data
console.log(response.data)
if (res.code !== '200') {
return _this.$message.error('获取消息收发记录,失败!')
}
// 获取列表数据
_this.tableData = res.data.list
// 获取列表的总记录数
_this.total = res.data.total
_this.$message.success('获取消息收发记录,成功!')
}).catch(error => {
// 关闭加载
_this.$message.error(error.toString())
})
this.$refs.tabulation.getList(this.queryInfo)
},
// 添加对话框,打开事件
applyAdd() {
... ... @@ -596,7 +468,7 @@
},
},
mounted() {
this.getList();
// this.getList();
// this.getYardList();
}
... ...
<template>
<div>
<!-- 列表区域-->
<el-row>
<template>
<el-table
:data="tableData"
border
:cell-style="{textAlign:'center'}"
style="border-radius: 10px 10px 0px 0px;line-height: 25px"
:header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small"
>
<el-table-column
fixed
prop="waybill"
label="货物单号"
width="120">
</el-table-column>
<el-table-column
prop="vol"
label="体积"
width="60">
</el-table-column>
<el-table-column
prop="weight"
label="重量"
width="60">
</el-table-column>
<el-table-column
prop="pcs"
label="件数"
width="60">
</el-table-column>
<el-table-column
prop="billweight"
label="计费重量"
width="70">
</el-table-column>
<el-table-column
prop="area"
label="库区"
width="60">
</el-table-column>
<el-table-column
prop="location"
label="库位"
width="60">
</el-table-column>
<el-table-column
prop="serialnumber"
label="流水号"
width="160">
</el-table-column>
<el-table-column
prop="station"
label="出入库场站"
width="100">
</el-table-column>
<el-table-column
prop="status"
label="状态"
width="80">
<template slot-scope="scope">
<span v-if="scope.row.status ==='0'">失败</span>
<span v-if="scope.row.status ==='1'">成功</span>
</template>
</el-table-column>
<el-table-column
prop="transcar"
label="运输车辆信息"
width="100">
</el-table-column>
<el-table-column
prop="transtype"
label="交易类型"
width="100">
</el-table-column>
<el-table-column
prop="custel"
label="客户联系电话"
width="140">
</el-table-column>
<el-table-column
prop="customer"
label="联系人姓名"
width="100">
</el-table-column>
<el-table-column
prop="customername"
label="客户名称"
width="80">
</el-table-column>
<el-table-column
prop="goodstype"
label="货物类型"
width="80">
</el-table-column>
<el-table-column
prop="house"
label="出入库仓库"
width="100">
</el-table-column>
<el-table-column
prop="ietype"
label="类型"
width="60">
<template slot-scope="scope">
<span v-if="scope.row.ietype ==='I'">进</span>
<span v-if="scope.row.ietype ==='E'">出</span>
</template>
</el-table-column>
<el-table-column
prop="opter"
label="出入库经办人"
width="100">
</el-table-column>
<el-table-column
prop="opttime"
label="出入库时间"
width="140">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="160">
<template slot-scope="scope">
<el-button type="success" size="mini" @click="applyEdit(scope.row)">编辑</el-button>
<el-button type="danger" size="mini" @click="applyDel(scope.$index,scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-row>
<el-row style="margin-top: 10px" class="toolbar">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="tabulationInfo.pageNum"
:page-size="tabulationInfo.pageSize"
:page-sizes="[10, 50, 100, 500]"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</el-row>
</div>
</template>
<script>
import {selectNewInventroyrecords} from "../../api/consigner/station";
export default {
name: "Tabulation",
props: [
'tabulationInfo'
],
data(){
return {
tableData: [],
total: 0
}
},
methods:{
getList() {
const _this = this
selectNewInventroyrecords(this.tabulationInfo).then((response) => {
const res = response.data
console.log(response.data)
if (res.code !== '200') {
return _this.$message.error('获取消息收发记录,失败!')
}
// 获取列表数据
_this.tableData = res.data.list
// 获取列表的总记录数
_this.total = res.data.total
_this.$message.success('获取消息收发记录,成功!')
}).catch(error => {
// 关闭加载
_this.$message.error(error.toString())
})
},
handleSizeChange(val) {
this.tabulationInfo.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.tabulationInfo.pageNum = val
this.getList()
},
},
mounted() {
this.getList();
},
watch:{
tabulationInfo(value){
console.log('from parent='+JSON.stringify(value))
}
}
}
</script>
<style scoped>
</style>
... ...