2024-09-29 14:19:30 +08:00
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
|
<div class="div1">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="div2" style="padding-bottom: 10px">
|
|
|
|
|
|
<el-form ref="form" :model="param" label-width="80px">
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
<el-form-item label="下发日期:">
|
|
|
|
|
|
<el-date-picker style="width: 325px"
|
|
|
|
|
|
v-model="param.issued_Date"
|
|
|
|
|
|
type="daterange"
|
|
|
|
|
|
align="right"
|
|
|
|
|
|
unlink-panels
|
|
|
|
|
|
range-separator="至"
|
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
|
:picker-options="pickerOptions">
|
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-button type="success" @click="find">查找</el-button>
|
|
|
|
|
|
<el-button type="success" @click="down">导出</el-button>
|
|
|
|
|
|
<el-button type="success" @click="rest">重置</el-button>
|
|
|
|
|
|
<el-checkbox v-model="checked" @change="Allquesr">是否显示全部查询条件</el-checkbox>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<el-table
|
|
|
|
|
|
v-loading="this.tableloding"
|
|
|
|
|
|
:height="MaxHeight"
|
|
|
|
|
|
:header-cell-style="{background:'#000',color:'#fff'}"
|
|
|
|
|
|
:span-method="objectSpanMethod"
|
|
|
|
|
|
:data="tableData"
|
|
|
|
|
|
id="educe-table"
|
|
|
|
|
|
ref="tableData"
|
|
|
|
|
|
style="width: 100%;">
|
|
|
|
|
|
<el-table-column v-for="item in columns" :key="item.prop" :prop="item.prop" :label="item.label" :min-width="item.minWidth">
|
|
|
|
|
|
<el-table-column v-if="item.label==='作业类型'"
|
|
|
|
|
|
prop="出库"
|
|
|
|
|
|
label="出库"
|
|
|
|
|
|
width="120">
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column v-if="item.label==='作业类型'"
|
|
|
|
|
|
prop="入库"
|
|
|
|
|
|
label="入库"
|
|
|
|
|
|
width="120">
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column v-if="item.label==='作业类型'"
|
|
|
|
|
|
prop="盘点"
|
|
|
|
|
|
label="盘点"
|
|
|
|
|
|
width="120">
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column v-if="item.label==='作业类型'"
|
|
|
|
|
|
prop="整理"
|
|
|
|
|
|
label="整理"
|
|
|
|
|
|
width="120">
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
<el-pagination
|
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
|
|
:current-page="pageNum"
|
|
|
|
|
|
:page-sizes="[ 50, 100, 200,500]"
|
|
|
|
|
|
:page-size="pageSize"
|
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
|
:total="total">
|
|
|
|
|
|
</el-pagination>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
pickerOptions: {
|
|
|
|
|
|
shortcuts: [{
|
|
|
|
|
|
text: '最近一周',
|
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
|
const end = new Date();
|
|
|
|
|
|
const start = new Date();
|
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}, {
|
|
|
|
|
|
text: '最近一个月',
|
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
|
const end = new Date();
|
|
|
|
|
|
const start = new Date();
|
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}, {
|
|
|
|
|
|
text: '最近三个月',
|
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
|
const end = new Date();
|
|
|
|
|
|
const start = new Date();
|
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}]
|
|
|
|
|
|
},
|
|
|
|
|
|
// 表头配置
|
|
|
|
|
|
columns: [
|
|
|
|
|
|
{
|
|
|
|
|
|
prop: '操作人',
|
|
|
|
|
|
minWidth: '150px',
|
|
|
|
|
|
label: '操作人'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
prop: '整理',
|
|
|
|
|
|
minWidth: '150px',
|
|
|
|
|
|
label: '整理(行)'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
prop: '拣货',
|
|
|
|
|
|
minWidth: '150px',
|
|
|
|
|
|
label: '拣货(行)'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
prop: '清点',
|
|
|
|
|
|
minWidth: '150px',
|
|
|
|
|
|
label: '清点(行)'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
prop: '合单',
|
|
|
|
|
|
minWidth: '150px',
|
|
|
|
|
|
label: '合单(按容器)'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
prop: '交单',
|
|
|
|
|
|
minWidth: '150px',
|
|
|
|
|
|
label: '交单(按容器)'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
prop: '盘点',
|
|
|
|
|
|
minWidth: '150px',
|
|
|
|
|
|
label: '盘点'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
prop: '入库',
|
|
|
|
|
|
minWidth: '150px',
|
|
|
|
|
|
label: '入库'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
prop: '移库',
|
|
|
|
|
|
minWidth: '150px',
|
|
|
|
|
|
label: '移库'
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
tableloding: false,
|
|
|
|
|
|
isShow:false,//是否展示全部搜索条件
|
|
|
|
|
|
tableData: [],
|
|
|
|
|
|
pageSize: 50
|
|
|
|
|
|
,spanArr: [], //每行合并数
|
|
|
|
|
|
pos: 0, //角标索引
|
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
|
total: 3,
|
|
|
|
|
|
//查询条件
|
|
|
|
|
|
param: {
|
|
|
|
|
|
issued_Date: []
|
|
|
|
|
|
},
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
checked: false,
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
computed:{
|
|
|
|
|
|
MaxHeight(){
|
|
|
|
|
|
return window.innerHeight - 240 +"px";
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
mounted: function () {
|
|
|
|
|
|
this.queryUser();
|
|
|
|
|
|
},
|
|
|
|
|
|
updated() {
|
|
|
|
|
|
// 每次更新会重新对 Table 进行重新布局
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
if (this.$refs.mutipleTable !== undefined) {
|
|
|
|
|
|
this.$refs.mutipleTable.doLayout()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
// 合并单元格样式,主要是针对要合并列的第一个单元格(有其他需要的可自行更改)
|
|
|
|
|
|
cellStyle({ row, column }) {
|
|
|
|
|
|
// 找到数组中列>1那一个单元格,就是需要改变的样式
|
|
|
|
|
|
if (row['mergeData'][column.property] && row['mergeData'][column.property][1] && row['mergeData'][column.property][1] > 1) {
|
|
|
|
|
|
return { 'text-align': 'left' }
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return {}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
objectSpanMethod({ row, column }) {
|
|
|
|
|
|
// 直接返回后端给的对应字段的单元格数据
|
|
|
|
|
|
return row['mergeData'][column.property]
|
|
|
|
|
|
},
|
|
|
|
|
|
handleEdit(index, row) {
|
|
|
|
|
|
console.log(index, row);
|
|
|
|
|
|
},
|
|
|
|
|
|
handleDelete(index, row) {
|
|
|
|
|
|
console.log(index, row);
|
|
|
|
|
|
},
|
|
|
|
|
|
handleSizeChange(val) {
|
|
|
|
|
|
console.log(`每页 ${val} 条`);
|
|
|
|
|
|
this.pageNum = 1;
|
|
|
|
|
|
this.pageSize = val;
|
|
|
|
|
|
this.queryUser();
|
|
|
|
|
|
},
|
|
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
|
|
console.log(`当前页: ${val}`);
|
|
|
|
|
|
this.pageNum = val;
|
|
|
|
|
|
this.queryUser();
|
|
|
|
|
|
},
|
|
|
|
|
|
queryUser() {
|
|
|
|
|
|
//列表数据加载
|
|
|
|
|
|
this.$axios.post(this.$httpUrl + '/RenXiao/queryList', {
|
|
|
|
|
|
pageSize: this.pageSize,
|
|
|
|
|
|
pageNum: this.pageNum,
|
|
|
|
|
|
param: this.param,
|
|
|
|
|
|
}).then(res => res.data)
|
|
|
|
|
|
.then(res => {
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
this.tableData = res.data
|
|
|
|
|
|
this.total = res.total
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error('获取数据失败');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
|
},err=>{
|
|
|
|
|
|
this.tableloding=false;
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
find(){
|
2024-09-29 15:34:17 +08:00
|
|
|
|
this.pageNum=1;
|
2024-09-29 14:19:30 +08:00
|
|
|
|
this.queryUser();
|
|
|
|
|
|
},
|
|
|
|
|
|
down(){
|
|
|
|
|
|
this.downExcel();
|
|
|
|
|
|
},
|
|
|
|
|
|
downExcel() {
|
|
|
|
|
|
//显示加载图
|
|
|
|
|
|
this.tableloding=true;
|
|
|
|
|
|
//发起请求:/Jianhuojiemian/download,请求方式为post,类型为 {responseType:'blob'}
|
|
|
|
|
|
//参数和搜索参数一样
|
|
|
|
|
|
this.$axios.post(this.$httpUrl + '/Xuliehaoqingdan/download', {
|
|
|
|
|
|
pageSize: this.pageSize,
|
|
|
|
|
|
pageNum: this.pageNum,
|
|
|
|
|
|
param: this.param,
|
|
|
|
|
|
},{responseType:'blob'}).then(res => {
|
|
|
|
|
|
this.tableloding=false;
|
|
|
|
|
|
//重命名文件
|
|
|
|
|
|
this.downloadFile(res.data,'序列号库存清点'+ '数据', 'xlsx')
|
|
|
|
|
|
});
|
|
|
|
|
|
//列表数据加载
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
downloadFile(obj, name, suffix) {
|
|
|
|
|
|
//解析流文件,进行下载保存
|
|
|
|
|
|
const url = window.URL.createObjectURL(new Blob([obj]))
|
|
|
|
|
|
const link = document.createElement('a')
|
|
|
|
|
|
link.style.display = 'none'
|
|
|
|
|
|
link.href = url
|
|
|
|
|
|
const fileName = this.parseTime(new Date()) + '-' + name + '.' + suffix
|
|
|
|
|
|
link.setAttribute('download', fileName)
|
|
|
|
|
|
document.body.appendChild(link)
|
|
|
|
|
|
link.click()
|
|
|
|
|
|
document.body.removeChild(link)
|
|
|
|
|
|
},
|
|
|
|
|
|
parseTime(time, cFormat) {
|
|
|
|
|
|
//获取当前时间
|
|
|
|
|
|
if (arguments.length === 0) {
|
|
|
|
|
|
return null
|
|
|
|
|
|
}
|
|
|
|
|
|
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
|
|
|
|
|
|
let date
|
|
|
|
|
|
if (typeof time === 'undefined' || time === null || time === 'null') {
|
|
|
|
|
|
return ''
|
|
|
|
|
|
} else if (typeof time === 'object') {
|
|
|
|
|
|
date = time
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
|
|
|
|
|
time = parseInt(time)
|
|
|
|
|
|
}
|
|
|
|
|
|
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
|
|
|
|
|
time = time * 1000
|
|
|
|
|
|
}
|
|
|
|
|
|
date = new Date(time)
|
|
|
|
|
|
}
|
|
|
|
|
|
const formatObj = {
|
|
|
|
|
|
y: date.getFullYear(),
|
|
|
|
|
|
m: date.getMonth() + 1,
|
|
|
|
|
|
d: date.getDate(),
|
|
|
|
|
|
h: date.getHours(),
|
|
|
|
|
|
i: date.getMinutes(),
|
|
|
|
|
|
s: date.getSeconds(),
|
|
|
|
|
|
a: date.getDay()
|
|
|
|
|
|
}
|
|
|
|
|
|
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
|
|
|
|
|
let value = formatObj[key]
|
|
|
|
|
|
// Note: getDay() returns 0 on Sunday
|
|
|
|
|
|
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
|
|
|
|
|
|
if (result.length > 0 && value < 10) {
|
|
|
|
|
|
value = '0' + value
|
|
|
|
|
|
}
|
|
|
|
|
|
return value || 0
|
|
|
|
|
|
})
|
|
|
|
|
|
return time_str
|
|
|
|
|
|
},
|
|
|
|
|
|
Allquesr(){
|
|
|
|
|
|
//查询按钮
|
|
|
|
|
|
if(this.checked){
|
|
|
|
|
|
this.isShow=true;
|
|
|
|
|
|
}else {
|
|
|
|
|
|
this.isShow=false;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
rest() {
|
|
|
|
|
|
//条件查询重置
|
|
|
|
|
|
this.checked=false;
|
|
|
|
|
|
this.isShow=false;
|
|
|
|
|
|
this.param={};
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|