|
|
|
@ -5,7 +5,19 @@
|
|
|
|
|
<!-- 搜索模块 --> |
|
|
|
|
<el-row v-if="search"> |
|
|
|
|
<!-- 查询模块 --> |
|
|
|
|
<el-form :inline="true" :model="query" class="el-fr-d"> |
|
|
|
|
<el-form :inline="true" :model="TopQuery" class="el-fr-d"> |
|
|
|
|
<el-form-item label="滞留扫描日期"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="TopQuery.time" |
|
|
|
|
type="datetimerange" |
|
|
|
|
unlink-panels |
|
|
|
|
range-separator="至" |
|
|
|
|
start-placeholder="开始时间" |
|
|
|
|
end-placeholder="结束时间" |
|
|
|
|
:shortcuts="shortcuts" |
|
|
|
|
:default-time="defaultTime2" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<!-- 查询按钮 --> |
|
|
|
|
<el-form-item class="el-btn"> |
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="searchChange">搜 索</el-button> |
|
|
|
@ -19,7 +31,7 @@
|
|
|
|
|
<div class="avue-crud__header"> |
|
|
|
|
<!-- 头部左侧按钮模块 --> |
|
|
|
|
<div class="avue-crud__left"> |
|
|
|
|
<el-button type="primary" @click="AddInfo" |
|
|
|
|
<el-button type="primary" @click="exportExcel" |
|
|
|
|
><el-icon><Download /></el-icon>导出</el-button |
|
|
|
|
> |
|
|
|
|
</div> |
|
|
|
@ -88,7 +100,7 @@
|
|
|
|
|
|
|
|
|
|
<script setup> |
|
|
|
|
import { ref, reactive, toRefs, computed, onMounted, nextTick, watch } from 'vue'; |
|
|
|
|
import { $_warehouseRetentionRecordPage } from '@/api/warehouse/warehouseRetentionRecord.js'; |
|
|
|
|
import { $_warehouseRetentionRecordPage ,$_warehouseRetentionScan} from '@/api/warehouse/warehouseRetentionRecord.js'; |
|
|
|
|
import { columnList } from '@/option/warehouse/warehouseRetentionRecord'; |
|
|
|
|
import { getDictionaryBiz } from '@/api/system/dict'; //字典 |
|
|
|
|
import { processRowProperty, setNodeHeight } from '@/utils/util'; |
|
|
|
@ -100,10 +112,12 @@ import dayjs from 'dayjs';
|
|
|
|
|
const $router = useRouter(); //跳转 |
|
|
|
|
const $useStore = useStore(); //权限 |
|
|
|
|
const $route = useRoute(); //获取地址栏参数 |
|
|
|
|
const TopQuery = ref({}); |
|
|
|
|
const details = reactive({ |
|
|
|
|
/** 是否开启搜索 */ |
|
|
|
|
search: false, |
|
|
|
|
/** 表格搜索条件 */ |
|
|
|
|
defaultTime2: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)], // '12:00:00', '08:00:00' |
|
|
|
|
query: {}, |
|
|
|
|
/** 时间快捷选择设置 */ |
|
|
|
|
shortcuts: [ |
|
|
|
@ -192,6 +206,7 @@ const {
|
|
|
|
|
zeroAdditionalRecordingInfo, |
|
|
|
|
popUpShow, |
|
|
|
|
recorddata, |
|
|
|
|
defaultTime2, |
|
|
|
|
} = toRefs(details); |
|
|
|
|
|
|
|
|
|
/** 展开列表控件 */ |
|
|
|
@ -208,6 +223,9 @@ const inputsc = (index, row) => {
|
|
|
|
|
const test = val => {}; |
|
|
|
|
/** 表格表头时间选择 */ |
|
|
|
|
const timesc = (index, row) => { |
|
|
|
|
if (row.prop == 'retentionScanTime') { |
|
|
|
|
row.prop = 'scanDate'; |
|
|
|
|
} |
|
|
|
|
console.log(index, row); |
|
|
|
|
if (!!index) { |
|
|
|
|
index = dayjs(index).format('YYYY-MM-DD'); |
|
|
|
@ -216,6 +234,7 @@ const timesc = (index, row) => {
|
|
|
|
|
if (!index) { |
|
|
|
|
delete details.query[row.prop]; |
|
|
|
|
} |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** 表格表头输入框搜索 */ |
|
|
|
@ -234,7 +253,14 @@ const selectionChange = list => {
|
|
|
|
|
}; |
|
|
|
|
// 网页顶部搜索按钮 |
|
|
|
|
const searchChange = () => { |
|
|
|
|
details.search = false; //关闭搜索 |
|
|
|
|
if (TopQuery.value.time?.length) { |
|
|
|
|
TopQuery.value.scanDateStart = dayjs(TopQuery.value.time[0]).format('YYYY-MM-DD HH:mm:ss'); |
|
|
|
|
TopQuery.value.scanDateEnd = dayjs(TopQuery.value.time[1]).format('YYYY-MM-DD HH:mm:ss'); |
|
|
|
|
} else { |
|
|
|
|
delete TopQuery.value.scanDateStart; |
|
|
|
|
delete TopQuery.value.scanDateStart; |
|
|
|
|
} |
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
// 每页多少条 |
|
|
|
|
const sizeChange = val => { |
|
|
|
@ -276,36 +302,38 @@ const onLoad = () => {
|
|
|
|
|
current: details.page.currentPage, |
|
|
|
|
size: details.page.pageSize, |
|
|
|
|
...details.query, |
|
|
|
|
...TopQuery.value, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
details.loadingObj.list = true; |
|
|
|
|
$_warehouseRetentionRecordPage(data).then(res => { |
|
|
|
|
console.log(res, '返回值'); |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
details.data = res.data.data.records || []; |
|
|
|
|
if (details.data?.length) { |
|
|
|
|
details.data.forEach(item => { |
|
|
|
|
if (item.retentionWay == 1) { |
|
|
|
|
item.retentionWayNameS = '扫描'; |
|
|
|
|
} else if (item.retentionWay == 2) { |
|
|
|
|
item.retentionWayNameS = '文员'; |
|
|
|
|
} |
|
|
|
|
if (item.scanType == 1) { |
|
|
|
|
item.scanType = '包件'; |
|
|
|
|
} else if (item.scanTypeS == 2) { |
|
|
|
|
item.scanTypeName = '订单'; |
|
|
|
|
} else if (item.scanType == 3) { |
|
|
|
|
item.scanTypeNameS = '托盘'; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$_warehouseRetentionRecordPage(data) |
|
|
|
|
.then(res => { |
|
|
|
|
console.log(res, '返回值'); |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
details.data = res.data.data.records || []; |
|
|
|
|
if (details.data?.length) { |
|
|
|
|
details.data.forEach(item => { |
|
|
|
|
if (item.retentionWay == 1) { |
|
|
|
|
item.retentionWayNameS = '扫描'; |
|
|
|
|
} else if (item.retentionWay == 2) { |
|
|
|
|
item.retentionWayNameS = '文员'; |
|
|
|
|
} |
|
|
|
|
if (item.conditions == 1) { |
|
|
|
|
item.conditionsNameS = '包件'; |
|
|
|
|
} else if (item.conditions == 2) { |
|
|
|
|
item.conditionsNameS = '定制品'; |
|
|
|
|
} else if (item.conditions == 3) { |
|
|
|
|
item.conditionsNameS = '零担'; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
details.page.total = res.data.data.total || 0; |
|
|
|
|
} |
|
|
|
|
details.page.total = res.data.data.total||0; |
|
|
|
|
} |
|
|
|
|
}).catch(()=>{ |
|
|
|
|
|
|
|
|
|
}).finally(()=>{ |
|
|
|
|
details.loadingObj.list = false; |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}) |
|
|
|
|
.finally(() => { |
|
|
|
|
details.loadingObj.list = false; |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
onLoad(); |
|
|
|
|
const view = row => { |
|
|
|
@ -320,6 +348,41 @@ const view = row => {
|
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
// 页面初始化方法 |
|
|
|
|
// 导出 |
|
|
|
|
const exportExcel = () => { |
|
|
|
|
ElMessageBox.confirm('是否导出数据?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
details.loadingObj.list = true; |
|
|
|
|
let data = { |
|
|
|
|
|
|
|
|
|
...details.query, |
|
|
|
|
...TopQuery.value, |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
$_warehouseRetentionScan(data).then(res => { |
|
|
|
|
details.loadingObj.list = false; |
|
|
|
|
downloadXls(res.data, `滞留包条明细.xlsx`); |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '导出成功', |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}); |
|
|
|
|
}; |
|
|
|
|
// 清理 |
|
|
|
|
const searchReset=()=>{ |
|
|
|
|
details.columnList.forEach(item=>{ |
|
|
|
|
item.values='' |
|
|
|
|
}) |
|
|
|
|
details.query={}, |
|
|
|
|
TopQuery.value={}, |
|
|
|
|
onLoad() |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|